9872 | 2024-03-13 20:05:09 | zhuyi | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 4736 KiB |
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
int n;
int s = 0;
string d;
cin>>n>>d;
for(int i= 0;i<d.size();i++){
if(d[i] =='R') s ++;
else s--;
}
if(s<0) cout<<0-s;
else cout<<s;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1816 KiB | ||||
2 | Accepted | 3ms | 2056 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2268 KiB | ||||
4 | Accepted | 2ms | 2360 KiB | ||||
5 | Accepted | 3ms | 2444 KiB | ||||
6 | Accepted | 3ms | 2692 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2776 KiB | ||||
8 | Accepted | 3ms | 3020 KiB | ||||
9 | Accepted | 3ms | 3264 KiB | ||||
10 | Accepted | 3ms | 3368 KiB | ||||
11 | Accepted | 3ms | 3612 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3672 KiB | ||||
13 | Accepted | 3ms | 3920 KiB | ||||
14 | Accepted | 2ms | 3892 KiB | ||||
15 | Accepted | 3ms | 3972 KiB | ||||
16 | Accepted | 3ms | 4076 KiB | ||||
17 | Accepted | 3ms | 4208 KiB | ||||
18 | Accepted | 3ms | 4308 KiB | ||||
19 | Accepted | 3ms | 4424 KiB | ||||
20 | Accepted | 3ms | 4556 KiB | ||||
21 | Accepted | 3ms | 4736 KiB |