6779 | 2023-12-19 09:46:40 | HunMartin23 | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 4564 KiB |
#include <iostream>
using namespace std;
int main()
{
int N,db=0,db1=0;
cin>>N;
char S[N];
for (int i=1;i<=N;i++)
{
cin>>S[i];
if (S[i]=='R')
{
db++;
}
else if (S[i]=='L')
{
db1++;
}
}
cout<<abs(db-db1);
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1872 KiB | ||||
2 | Accepted | 3ms | 2068 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2308 KiB | ||||
4 | Accepted | 3ms | 2364 KiB | ||||
5 | Accepted | 3ms | 2608 KiB | ||||
6 | Accepted | 3ms | 2728 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2952 KiB | ||||
8 | Accepted | 3ms | 3160 KiB | ||||
9 | Accepted | 3ms | 3396 KiB | ||||
10 | Accepted | 3ms | 3408 KiB | ||||
11 | Accepted | 3ms | 3456 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3588 KiB | ||||
13 | Accepted | 3ms | 3972 KiB | ||||
14 | Accepted | 3ms | 3940 KiB | ||||
15 | Accepted | 3ms | 4144 KiB | ||||
16 | Accepted | 3ms | 4132 KiB | ||||
17 | Accepted | 3ms | 4256 KiB | ||||
18 | Accepted | 3ms | 4284 KiB | ||||
19 | Accepted | 3ms | 4556 KiB | ||||
20 | Accepted | 3ms | 4564 KiB | ||||
21 | Accepted | 3ms | 4488 KiB |