# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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.