6569 | 2023-12-12 09:43:46 | haistavittu | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 4240 KiB |
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
int pos = 0;
string s;
cin >> n >> s;
for(char c : s) {
if(c == 'R') {
pos++;
} else {
pos--;
}
}
cout << abs(pos);
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1808 KiB | ||||
2 | Accepted | 3ms | 2004 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2364 KiB | ||||
4 | Accepted | 3ms | 2356 KiB | ||||
5 | Accepted | 3ms | 2552 KiB | ||||
6 | Accepted | 3ms | 2672 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2920 KiB | ||||
8 | Accepted | 3ms | 3096 KiB | ||||
9 | Accepted | 3ms | 3308 KiB | ||||
10 | Accepted | 3ms | 3560 KiB | ||||
11 | Accepted | 3ms | 3608 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3720 KiB | ||||
13 | Accepted | 3ms | 3912 KiB | ||||
14 | Accepted | 3ms | 4000 KiB | ||||
15 | Accepted | 3ms | 4008 KiB | ||||
16 | Accepted | 3ms | 4096 KiB | ||||
17 | Accepted | 3ms | 4124 KiB | ||||
18 | Accepted | 3ms | 4092 KiB | ||||
19 | Accepted | 3ms | 4220 KiB | ||||
20 | Accepted | 3ms | 4212 KiB | ||||
21 | Accepted | 3ms | 4240 KiB |