№ | Пользователь | Рейтинг |
---|---|---|
1 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | atcoder_official | 161 |
3 | Um_nik | 161 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
Название |
---|
I don't know, how it can be compiled, but it is wrong:
Use vector instead:
Can you tell me why !? you say that therse is'nt array of strings !?
is array, but according C++ standard, array's length must be constant, which is known at compile-time. In your case n is unknown at compile-time, so it is undefined behaviour.
It’s not undefined behaviour. According to the standard, the program is invalid, and a strictly conforming compiler will reject it, i. e. refuse to compile. However, in practice compilers support this as a language extension.
Note that variable length arrays are perfectly valid in C since C99.
Another bug:
1) Use "return a < b;" in cmp function 2) And use
Instead
Accepted! big thanks! :)
But I don't understand what is difference of them !
There is no problem in
here's everything ok. :)
The potential problem is in
because sort and other functions from
<algorithm>
header expect strict predicate ( less , not lessOrEqual). In some compilers, using lessOrEqual can bring to runtime-assert-check. For example:Gives debug-assert in MSVS 2010:
But it's not critical for problem acceptance on contest (because problem runs not in debug config), it's right way to make reliable software. :)
I understand! thanks! :)