3737 | 2023-03-02 16:22:50 | Gabor | Bolha a számegyenesen | cpp11 | Accepted 100/100 | 3ms | 4260 KiB |
#include <iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
int n,x=0;
cin>>n;
string a;
cin>>a;
for(int i=0;i<n;i++)
{
if(a[i]=='R')
x++;
else
x--;
}
cout<<abs(x);
return 0;
}
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 | 2272 KiB | ||||
4 | Accepted | 2ms | 2464 KiB | ||||
5 | Accepted | 2ms | 2540 KiB | ||||
6 | Accepted | 3ms | 2672 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 2ms | 2908 KiB | ||||
8 | Accepted | 2ms | 3052 KiB | ||||
9 | Accepted | 2ms | 3084 KiB | ||||
10 | Accepted | 2ms | 3300 KiB | ||||
11 | Accepted | 2ms | 3296 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3540 KiB | ||||
13 | Accepted | 2ms | 3752 KiB | ||||
14 | Accepted | 2ms | 3848 KiB | ||||
15 | Accepted | 2ms | 3852 KiB | ||||
16 | Accepted | 2ms | 4072 KiB | ||||
17 | Accepted | 2ms | 4164 KiB | ||||
18 | Accepted | 2ms | 4176 KiB | ||||
19 | Accepted | 2ms | 4180 KiB | ||||
20 | Accepted | 2ms | 4180 KiB | ||||
21 | Accepted | 3ms | 4260 KiB |