# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Name |
---|
row = ceil((k-n)/double(m-1));
First rule of float numbers: never use float numbers.
row = (k-n + (m-2)) / (m-1);
This gives accepted. http://mirror.codeforces.com/contest/976/submission/37799166
P.S. not sure why it gives AC in C++17. Better optimizatior, maybe.
Thank you , i got it now , that case is not picking up all the precisions and so ceiling was not working there , so integer ceiling or using a long double instead of double gives AC. Thanks a lot , lesson learned :)
I actually wasn't exaggerating: never use double unless it's printf function and problem except a float answer. Almost all of the problem (on your and mine level at least) can be solved without float numbers, and you won't get a lot of problems using them. Just an advice, ofc.