In this problem http://codeforces.com/contest/454/problem/C when i enter 6 3 it gives me the same value as when i calculate it on my personal calculator which is different from the output of second case
My code : 14419837
№ | Пользователь | Рейтинг |
---|---|---|
1 | ecnerwala | 3649 |
2 | Benq | 3581 |
3 | jiangly | 3578 |
4 | orzdevinwang | 3570 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | tourist | 3565 |
8 | maroonrk | 3531 |
9 | Radewoosh | 3521 |
10 | Um_nik | 3482 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | maomao90 | 174 |
2 | awoo | 164 |
3 | adamant | 161 |
4 | TheScrasse | 159 |
5 | nor | 158 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 152 |
8 | SecondThread | 146 |
8 | orz | 146 |
10 | pajenegod | 145 |
In this problem http://codeforces.com/contest/454/problem/C when i enter 6 3 it gives me the same value as when i calculate it on my personal calculator which is different from the output of second case
My code : 14419837
In problem 266A eclipse tell me this error : comparison with string literal results in unspecified behaviour [-Waddress] and tell me that the error is here if (q[i] == "B" && q[i+1] == "G") my code ~~~~~
using namespace std ;
int main(){
int n , time ;
cin >> n >> time ;
char q[n][10];
for (int i = 0 ; i<n ; i++){
cin >> q[i];
}
for (int l = 0 ; l<time ; l++){
for (int i = 0 ; i<n ; i++){ if (q[i] == "B" && q[i+1] == "G"){
swap(q[i],q[i+1]);
}
} }
for (int i = 0 ; i<n ; i++){
cout <<q[i];
}
}
~~~~~
Название |
---|