68872023-12-19 14:12:47barmi3Bevásárláscpp17Wrong answer 0/1003ms3808 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1872 KiB
2Wrong answer3ms2120 KiB
3Wrong answer3ms2364 KiB
subtask20/10
4Wrong answer2ms2444 KiB
5Wrong answer3ms2576 KiB
6Wrong answer3ms2912 KiB
subtask30/20
7Wrong answer3ms2832 KiB
8Wrong answer3ms3000 KiB
9Wrong answer3ms3080 KiB
10Wrong answer3ms3108 KiB
subtask40/30
11Wrong answer3ms3388 KiB
12Wrong answer3ms3544 KiB
13Wrong answer3ms3704 KiB
14Wrong answer3ms3808 KiB
subtask50/40
15Wrong answer3ms3720 KiB
16Wrong answer3ms3740 KiB
17Wrong answer3ms3696 KiB
18Wrong answer3ms3696 KiB
19Wrong answer3ms3720 KiB
20Wrong answer3ms3712 KiB