Hey!
If I'm using cin/cout
with ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
, does scanf/printf
still better to use ?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
Hey!
If I'm using cin/cout
with ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
, does scanf/printf
still better to use ?
Hey!
So I am trying to solve 1187D - Subarray Sorting, but I am getting TLE, I believe that my solve function is O(nlog(n)), so can anyone help me get what is so slow in my solution?
Here is my solution : 57491327
UPD: I found out the problem, it's because of the memset (again), I needed to fill only n elements not the hole arrays :)
Hey! In the last contest I was getting TLE on a problem, I thought my solution was not optimal, now I tried to solve it but using a loop to clear all elements of the array instead of "memset" -which I was using- and I got AC!! So which one is better ??
UPD: found that the TLE then using "memset" was because there was a mistake with the size of the array (which I don't know why I got TLE not RTE or something like that!!). But anyway, the time for the solution when using a "for" loop is like " 156 ms ", while it is " 1294 ms " when using "memset !!!
Name |
---|