6857 | 2023-12-19 12:32:43 | Bea124 | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 3432 KiB |
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,h=0;
char irany;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>irany;
if(irany=='L')
h=h-1;
if(irany=='R')
h=h+1;
}
cout<<abs(h);
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1876 KiB | ||||
2 | Accepted | 3ms | 2124 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2280 KiB | ||||
4 | Accepted | 3ms | 2492 KiB | ||||
5 | Accepted | 3ms | 2576 KiB | ||||
6 | Accepted | 3ms | 2572 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2692 KiB | ||||
8 | Accepted | 3ms | 2708 KiB | ||||
9 | Accepted | 3ms | 2916 KiB | ||||
10 | Accepted | 3ms | 3032 KiB | ||||
11 | Accepted | 3ms | 3008 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3004 KiB | ||||
13 | Accepted | 3ms | 3004 KiB | ||||
14 | Accepted | 3ms | 3012 KiB | ||||
15 | Accepted | 3ms | 3164 KiB | ||||
16 | Accepted | 3ms | 3132 KiB | ||||
17 | Accepted | 3ms | 3132 KiB | ||||
18 | Accepted | 3ms | 3020 KiB | ||||
19 | Accepted | 3ms | 3264 KiB | ||||
20 | Accepted | 3ms | 3372 KiB | ||||
21 | Accepted | 3ms | 3432 KiB |