№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3839 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3612 |
7 | Geothermal | 3569 |
8 | ecnerwala | 3494 |
9 | Um_nik | 3396 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | Um_nik | 164 |
2 | -is-this-fft- | 162 |
3 | maomao90 | 159 |
3 | atcoder_official | 159 |
5 | cry | 158 |
5 | awoo | 158 |
7 | adamant | 155 |
8 | nor | 154 |
9 | TheScrasse | 153 |
10 | Dominater069 | 152 |
Название |
---|
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://codeforces.net/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.