№ | Пользователь | Рейтинг |
---|---|---|
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 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
Название |
---|
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! :)