| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3611 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | Radewoosh | 3415 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | XVIII | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 145 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 132 |
| Name |
|---|



add these 2 magic lines:
ios::sync_with_stdio(false); cin.tie(0);
Okay, sorry I had never heard of these functions before.
I tried to read about it here:link
My understanding is that the ios::sync line is needed to synchronize the outputs when we use both cout of C++ and print() of C but I have only used C++ then why should I use that line?
No, it's the opposite.
By default, the C++ streams have some complicated and relatively time-expensive logic to make sure that if you mix
printf-style andstd::cout-style streams everything will still be read and printed in the correct order.However, if you're sure your program only uses
cinandcoutyou can turn off this synchronization withios::sync_with_stdio(false)and make input considerably faster.You said "identical" it's not.
ios::sync_with_stdio(false); cin.tie(0);
Also you need to be careful with "endl" too.
He is new in cf. why some people are downvoting his post? I think we should appreciate him at the beginning and help him to find out his mistake.
Downvotes can teach as well.When I opened my account I also shitposted and I got a lot of downvotes.I got very angry that day but now I understand why it was downvoted.
the thing is, he isn't trash-posting...
...
1.)ios::sync_with_stdio(false); cin.tie(0);
use this for fast input output2.)Avoid using "endl" instead using "\n";
3.) never underestimate a newbie
or
Lmao, agree with the first 2
Just was curious about the last line. Why should we avoid endl?
if you are using endl more than 1e4 time, then you should use "\n" instead , since endl is slower, as it also flush the output.
Never underestimate a specialist
Unless you're Umnik
Agree with the third
if input of a problem contains number <= 10^18, u should use ios::sync_with_stdio(false); cin.tie(0);. It will be much faster
Why he got downvotes, I think there's nothing wrong.