№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
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 |
Название |
---|
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! :)