6813 | 2023-12-19 10:33:18 | VKristof | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 3552 KiB |
#include <iostream>
using namespace std;
int main()
{
int a,b=0;
cin>>a;
char c[a];
for(int i=0; i<a; i++)
{
cin>>c[i];
}
for(int i=0; i<a; i++)
{
if(c[i]=='R')
{
b=b-1;
}
else
{
b=b+1;
}
}
if(b<0)
cout<<b*-1;
else
cout<<b;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1880 KiB | ||||
2 | Accepted | 3ms | 2064 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2284 KiB | ||||
4 | Accepted | 3ms | 2492 KiB | ||||
5 | Accepted | 3ms | 2576 KiB | ||||
6 | Accepted | 3ms | 2580 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2816 KiB | ||||
8 | Accepted | 3ms | 3064 KiB | ||||
9 | Accepted | 3ms | 3008 KiB | ||||
10 | Accepted | 3ms | 3244 KiB | ||||
11 | Accepted | 3ms | 3212 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3332 KiB | ||||
13 | Accepted | 3ms | 3344 KiB | ||||
14 | Accepted | 3ms | 3464 KiB | ||||
15 | Accepted | 3ms | 3456 KiB | ||||
16 | Accepted | 3ms | 3428 KiB | ||||
17 | Accepted | 3ms | 3540 KiB | ||||
18 | Accepted | 3ms | 3548 KiB | ||||
19 | Accepted | 3ms | 3552 KiB | ||||
20 | Accepted | 3ms | 3552 KiB | ||||
21 | Accepted | 3ms | 3432 KiB |