I was solving Div.1 264A . But I am getting TLE for that which I think I shouldn't get. After changing lang from GNU C++17 to GNU C++11, I got accecpted for that problem using same code. Is there any specific reason for that ?
Accecpted : GNU C++11 submission TLE : GNU C++17 submission
Thank you.
1)Running time can be different on different run.The AC-submission ran in
1981ms
, which is very close to the2000ms
time limit.2)Possibly doing
flush
operation inC++17
is slower than inC++11
flush
operation is somewhat slow.endl
will automatically doflush
operation as well as creating a new line every time.You can use
\n
instead ofendl
, the first one won't do flush operation for each time.Thank you very much