67982023-12-19 10:17:04turitamasBolha a számegyenesencpp17Wrong answer 0/1003ms4876 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, pozicio, jump;
    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 answer3ms2064 KiB
subtask20/15
3Wrong answer3ms2280 KiB
4Wrong answer3ms2492 KiB
5Wrong answer3ms2736 KiB
6Wrong answer3ms2816 KiB
subtask30/10
7Wrong answer3ms2940 KiB
8Wrong answer3ms3068 KiB
9Wrong answer3ms3160 KiB
10Wrong answer3ms3336 KiB
11Wrong answer3ms3428 KiB
subtask40/75
12Wrong answer3ms3556 KiB
13Wrong answer3ms3768 KiB
14Wrong answer3ms3844 KiB
15Wrong answer3ms4000 KiB
16Wrong answer3ms4132 KiB
17Wrong answer3ms4336 KiB
18Wrong answer3ms4420 KiB
19Wrong answer3ms4664 KiB
20Wrong answer3ms4724 KiB
21Wrong answer3ms4876 KiB