67792023-12-19 09:46:40HunMartin23Bolha a számegyenesencpp17Accepted 100/1003ms4564 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1872 KiB
2Accepted3ms2068 KiB
subtask215/15
3Accepted3ms2308 KiB
4Accepted3ms2364 KiB
5Accepted3ms2608 KiB
6Accepted3ms2728 KiB
subtask310/10
7Accepted3ms2952 KiB
8Accepted3ms3160 KiB
9Accepted3ms3396 KiB
10Accepted3ms3408 KiB
11Accepted3ms3456 KiB
subtask475/75
12Accepted3ms3588 KiB
13Accepted3ms3972 KiB
14Accepted3ms3940 KiB
15Accepted3ms4144 KiB
16Accepted3ms4132 KiB
17Accepted3ms4256 KiB
18Accepted3ms4284 KiB
19Accepted3ms4556 KiB
20Accepted3ms4564 KiB
21Accepted3ms4488 KiB