98722024-03-13 20:05:09zhuyiBolha a számegyenesencpp17Accepted 100/1003ms4736 KiB
#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main()
{
    int n;
    int s = 0;
    string d;
    cin>>n>>d;
    for(int i= 0;i<d.size();i++){
        if(d[i] =='R') s ++;
        else s--;
    }
    if(s<0) cout<<0-s;
    else cout<<s;

}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1816 KiB
2Accepted3ms2056 KiB
subtask215/15
3Accepted3ms2268 KiB
4Accepted2ms2360 KiB
5Accepted3ms2444 KiB
6Accepted3ms2692 KiB
subtask310/10
7Accepted3ms2776 KiB
8Accepted3ms3020 KiB
9Accepted3ms3264 KiB
10Accepted3ms3368 KiB
11Accepted3ms3612 KiB
subtask475/75
12Accepted3ms3672 KiB
13Accepted3ms3920 KiB
14Accepted2ms3892 KiB
15Accepted3ms3972 KiB
16Accepted3ms4076 KiB
17Accepted3ms4208 KiB
18Accepted3ms4308 KiB
19Accepted3ms4424 KiB
20Accepted3ms4556 KiB
21Accepted3ms4736 KiB