6888 | 2023-12-19 14:20:33 | csakesz | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 4264 KiB |
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int N;
int k=0;
cin>>N;
char S;
for(int i=0;i<N;i++)
{
cin>>S;
if(S=='R')
{
k+=1;
}
else if(S=='L')
{
k=k-1;
}
}
cout<<abs(k);
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 2000 KiB | ||||
2 | Accepted | 3ms | 2108 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2188 KiB | ||||
4 | Accepted | 3ms | 2316 KiB | ||||
5 | Accepted | 3ms | 2528 KiB | ||||
6 | Accepted | 3ms | 2740 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2952 KiB | ||||
8 | Accepted | 3ms | 3024 KiB | ||||
9 | Accepted | 3ms | 3072 KiB | ||||
10 | Accepted | 3ms | 3280 KiB | ||||
11 | Accepted | 3ms | 3532 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3680 KiB | ||||
13 | Accepted | 3ms | 3780 KiB | ||||
14 | Accepted | 3ms | 3960 KiB | ||||
15 | Accepted | 3ms | 4104 KiB | ||||
16 | Accepted | 3ms | 4264 KiB | ||||
17 | Accepted | 3ms | 4248 KiB | ||||
18 | Accepted | 3ms | 4240 KiB | ||||
19 | Accepted | 3ms | 4156 KiB | ||||
20 | Accepted | 3ms | 4152 KiB | ||||
21 | Accepted | 3ms | 4152 KiB |