3275 | 2023-02-23 16:26:13 | BalintGeza | Bolha a számegyenesen | cpp11 | Accepted 100/100 | 3ms | 4148 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int h;
cin>>h;
string n;
int i, l=0, r=0;
cin>>n;
for(i=0;i<h;i++)
{
if(n.at(i)=='L')
l++;
else if(n.at(i)=='R')
r++;
}
int lepes, lepes1;
lepes=l-r;
lepes1=abs(lepes);
cout<<lepes1;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1808 KiB | ||||
2 | Accepted | 3ms | 2004 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2212 KiB | ||||
4 | Accepted | 2ms | 2336 KiB | ||||
5 | Accepted | 3ms | 2548 KiB | ||||
6 | Accepted | 3ms | 2784 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 3028 KiB | ||||
8 | Accepted | 3ms | 3236 KiB | ||||
9 | Accepted | 2ms | 3232 KiB | ||||
10 | Accepted | 2ms | 3328 KiB | ||||
11 | Accepted | 3ms | 3408 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 2ms | 3532 KiB | ||||
13 | Accepted | 3ms | 3636 KiB | ||||
14 | Accepted | 2ms | 3724 KiB | ||||
15 | Accepted | 2ms | 3720 KiB | ||||
16 | Accepted | 3ms | 3700 KiB | ||||
17 | Accepted | 3ms | 3936 KiB | ||||
18 | Accepted | 2ms | 3932 KiB | ||||
19 | Accepted | 2ms | 4048 KiB | ||||
20 | Accepted | 3ms | 3904 KiB | ||||
21 | Accepted | 3ms | 4148 KiB |