6783 | 2023-12-19 09:53:48 | AMDFanboy | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 4116 KiB |
#include <iostream>
using namespace std;
int main()
{
int N,szamlalol=0, szamlalor=0,ered;
cin>>N;
char S;
for (int i=0; i<N; i++)
{
cin>>S;
if (S=='L')
{
szamlalol++;
}
else if (S=='R')
{
szamlalor++;
}
}
ered=abs(szamlalol-szamlalor);
cout<<ered;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1876 KiB | ||||
2 | Accepted | 3ms | 2124 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2180 KiB | ||||
4 | Accepted | 3ms | 2248 KiB | ||||
5 | Accepted | 3ms | 2380 KiB | ||||
6 | Accepted | 3ms | 2592 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2832 KiB | ||||
8 | Accepted | 3ms | 2888 KiB | ||||
9 | Accepted | 3ms | 3016 KiB | ||||
10 | Accepted | 3ms | 3260 KiB | ||||
11 | Accepted | 3ms | 3436 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3524 KiB | ||||
13 | Accepted | 3ms | 3524 KiB | ||||
14 | Accepted | 3ms | 3652 KiB | ||||
15 | Accepted | 3ms | 3740 KiB | ||||
16 | Accepted | 3ms | 3732 KiB | ||||
17 | Accepted | 3ms | 3872 KiB | ||||
18 | Accepted | 3ms | 3944 KiB | ||||
19 | Accepted | 3ms | 3960 KiB | ||||
20 | Accepted | 3ms | 4116 KiB | ||||
21 | Accepted | 3ms | 3984 KiB |