3273 | 2023-02-23 16:20:24 | Markopolo | Bolha a számegyenesen | cpp14 | Accepted 100/100 | 3ms | 4084 KiB |
#include <iostream>
using namespace std;
int main()
{
int n,i,r=0,l=0;
char c;
cin>>n;
for(i=0;i<n;i++)
{
cin>>c;
if(c=='R')
r++;
if(c=='L')
l++;
}
cout<<abs(r-l);
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1872 KiB | ||||
2 | Accepted | 3ms | 2120 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2336 KiB | ||||
4 | Accepted | 3ms | 2548 KiB | ||||
5 | Accepted | 3ms | 2628 KiB | ||||
6 | Accepted | 3ms | 2880 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 3088 KiB | ||||
8 | Accepted | 2ms | 3116 KiB | ||||
9 | Accepted | 3ms | 3248 KiB | ||||
10 | Accepted | 3ms | 3340 KiB | ||||
11 | Accepted | 2ms | 3460 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 2ms | 3552 KiB | ||||
13 | Accepted | 3ms | 3788 KiB | ||||
14 | Accepted | 3ms | 4040 KiB | ||||
15 | Accepted | 3ms | 4064 KiB | ||||
16 | Accepted | 3ms | 3964 KiB | ||||
17 | Accepted | 3ms | 3960 KiB | ||||
18 | Accepted | 3ms | 3964 KiB | ||||
19 | Accepted | 3ms | 3964 KiB | ||||
20 | Accepted | 3ms | 4084 KiB | ||||
21 | Accepted | 3ms | 3960 KiB |