6796 | 2023-12-19 10:14:18 | ivan | Bolha a számegyenesen | cpp17 | Wrong answer 0/100 | 3ms | 4292 KiB |
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n, pozicio, jump=0;
char s;
cin>>n;
for(int i=0; i<n; i++)
{
cin>>s;
if(s=='L')
{
pozicio--;
}
if(s=='R')
{
pozicio++;
}
}
jump=abs(jump-pozicio);
cout<<jump;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1876 KiB | ||||
2 | Wrong answer | 3ms | 2120 KiB | ||||
subtask2 | 0/15 | ||||||
3 | Wrong answer | 3ms | 2332 KiB | ||||
4 | Wrong answer | 3ms | 2580 KiB | ||||
5 | Wrong answer | 3ms | 2704 KiB | ||||
6 | Wrong answer | 3ms | 2912 KiB | ||||
subtask3 | 0/10 | ||||||
7 | Wrong answer | 3ms | 3124 KiB | ||||
8 | Wrong answer | 3ms | 3248 KiB | ||||
9 | Wrong answer | 3ms | 3208 KiB | ||||
10 | Wrong answer | 3ms | 3336 KiB | ||||
11 | Wrong answer | 3ms | 3588 KiB | ||||
subtask4 | 0/75 | ||||||
12 | Wrong answer | 3ms | 3568 KiB | ||||
13 | Wrong answer | 3ms | 3788 KiB | ||||
14 | Wrong answer | 3ms | 3856 KiB | ||||
15 | Wrong answer | 3ms | 3860 KiB | ||||
16 | Wrong answer | 3ms | 4104 KiB | ||||
17 | Wrong answer | 3ms | 4176 KiB | ||||
18 | Wrong answer | 3ms | 4292 KiB | ||||
19 | Wrong answer | 3ms | 4196 KiB | ||||
20 | Wrong answer | 3ms | 4192 KiB | ||||
21 | Wrong answer | 3ms | 4268 KiB |