6887 | 2023-12-19 14:12:47 | barmi3 | Bevásárlás | cpp17 | Wrong answer 0/100 | 3ms | 3808 KiB |
#include <iostream>
using namespace std;
int main()
{
int N,R=0,L=0;
cin>>N;
char S[N];
for(int i=0;i<N;i++)
{
cin>>S[i];
}
for(int i=0;i<N;i++)
{
if(S[i]=='R')
R++;
if(S[i]=='L')
L++;
}
if(R>=L)
cout<<R-L<<endl;
if(L>R)
cout<<L-R<<endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1872 KiB | ||||
2 | Wrong answer | 3ms | 2120 KiB | ||||
3 | Wrong answer | 3ms | 2364 KiB | ||||
subtask2 | 0/10 | ||||||
4 | Wrong answer | 2ms | 2444 KiB | ||||
5 | Wrong answer | 3ms | 2576 KiB | ||||
6 | Wrong answer | 3ms | 2912 KiB | ||||
subtask3 | 0/20 | ||||||
7 | Wrong answer | 3ms | 2832 KiB | ||||
8 | Wrong answer | 3ms | 3000 KiB | ||||
9 | Wrong answer | 3ms | 3080 KiB | ||||
10 | Wrong answer | 3ms | 3108 KiB | ||||
subtask4 | 0/30 | ||||||
11 | Wrong answer | 3ms | 3388 KiB | ||||
12 | Wrong answer | 3ms | 3544 KiB | ||||
13 | Wrong answer | 3ms | 3704 KiB | ||||
14 | Wrong answer | 3ms | 3808 KiB | ||||
subtask5 | 0/40 | ||||||
15 | Wrong answer | 3ms | 3720 KiB | ||||
16 | Wrong answer | 3ms | 3740 KiB | ||||
17 | Wrong answer | 3ms | 3696 KiB | ||||
18 | Wrong answer | 3ms | 3696 KiB | ||||
19 | Wrong answer | 3ms | 3720 KiB | ||||
20 | Wrong answer | 3ms | 3712 KiB |