6853 | 2023-12-19 12:21:28 | lennon014 | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 3564 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1688 KiB | ||||
2 | Accepted | 3ms | 1848 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2088 KiB | ||||
4 | Accepted | 3ms | 2272 KiB | ||||
5 | Accepted | 3ms | 2484 KiB | ||||
6 | Accepted | 3ms | 2732 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2964 KiB | ||||
8 | Accepted | 3ms | 3028 KiB | ||||
9 | Accepted | 3ms | 3028 KiB | ||||
10 | Accepted | 3ms | 3028 KiB | ||||
11 | Accepted | 3ms | 3028 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3152 KiB | ||||
13 | Accepted | 3ms | 3240 KiB | ||||
14 | Accepted | 3ms | 3320 KiB | ||||
15 | Accepted | 3ms | 3320 KiB | ||||
16 | Accepted | 3ms | 3432 KiB | ||||
17 | Accepted | 3ms | 3352 KiB | ||||
18 | Accepted | 3ms | 3324 KiB | ||||
19 | Accepted | 3ms | 3316 KiB | ||||
20 | Accepted | 3ms | 3324 KiB | ||||
21 | Accepted | 3ms | 3564 KiB |