68532023-12-19 12:21:28lennon014Bolha a számegyenesencpp17Accepted 100/1003ms3564 KiB
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

int main() {
    short int n, k=0;
    string s;
    cin>>n;
    cin>>s;
    for(short int i=0;i<s.length();i++){
        if(s[i]=='R'){
            k++;
        }else{
            k--;
        }
    }
    cout<<abs(0+k);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1688 KiB
2Accepted3ms1848 KiB
subtask215/15
3Accepted3ms2088 KiB
4Accepted3ms2272 KiB
5Accepted3ms2484 KiB
6Accepted3ms2732 KiB
subtask310/10
7Accepted3ms2964 KiB
8Accepted3ms3028 KiB
9Accepted3ms3028 KiB
10Accepted3ms3028 KiB
11Accepted3ms3028 KiB
subtask475/75
12Accepted3ms3152 KiB
13Accepted3ms3240 KiB
14Accepted3ms3320 KiB
15Accepted3ms3320 KiB
16Accepted3ms3432 KiB
17Accepted3ms3352 KiB
18Accepted3ms3324 KiB
19Accepted3ms3316 KiB
20Accepted3ms3324 KiB
21Accepted3ms3564 KiB