Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя signature

Автор signature, история, 4 года назад, По-английски

I was getting this error in some of the problems and my solution was getting Memory Limit Exceeded on Test 1 or Wrong Answer on Test 1. But after adding below lines my solutions got accepted.

ifstream cin("input.txt"); ofstream cout("output.txt");

Link of failed submission

Link of passed submission

Problem253 A

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

If you define cin and cout as file streams in main function, they are not visible in the auxiliary function. So the first submission tries to read from the standard input instead of file stream.