67962023-12-19 10:14:18ivanBolha a számegyenesencpp17Wrong answer 0/1003ms4292 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1876 KiB
2Wrong answer3ms2120 KiB
subtask20/15
3Wrong answer3ms2332 KiB
4Wrong answer3ms2580 KiB
5Wrong answer3ms2704 KiB
6Wrong answer3ms2912 KiB
subtask30/10
7Wrong answer3ms3124 KiB
8Wrong answer3ms3248 KiB
9Wrong answer3ms3208 KiB
10Wrong answer3ms3336 KiB
11Wrong answer3ms3588 KiB
subtask40/75
12Wrong answer3ms3568 KiB
13Wrong answer3ms3788 KiB
14Wrong answer3ms3856 KiB
15Wrong answer3ms3860 KiB
16Wrong answer3ms4104 KiB
17Wrong answer3ms4176 KiB
18Wrong answer3ms4292 KiB
19Wrong answer3ms4196 KiB
20Wrong answer3ms4192 KiB
21Wrong answer3ms4268 KiB