rn201's blog

By rn201, history, 10 months ago, In English

This is the problem . https://codeforces.com/contest/1867/problem/C In one solution i am deleting the #define which are not used and in the program and the program gets accepted . But in another the #define function are given but is of no use But it's Idleness limit exceeded on test 1. These are the two solution== Correct one= https://codeforces.com/contest/1867/submission/226153692 Wrong One= https://codeforces.com/contest/1867/submission/226154349

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
10 months ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

std::endl is equivalent to \n + std::flush. In interactive problems, you want to flush the output stream everytime you ask a query. Your template replaces std::endl with \n which is usually not an issue (and even increases speed) but is something to be weary of in interactive problems.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

You can't do this in interactive problems:

#define endl "\n"