67942023-12-19 10:07:17turitamasBolha a számegyenesencpp17Wrong answer 0/1003ms3160 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 answer3ms1748 KiB
2Wrong answer3ms1988 KiB
subtask20/15
3Wrong answer3ms2204 KiB
4Wrong answer3ms2292 KiB
5Wrong answer3ms2208 KiB
6Wrong answer3ms2204 KiB
subtask30/10
7Wrong answer3ms2208 KiB
8Wrong answer3ms2336 KiB
9Wrong answer3ms2420 KiB
10Wrong answer3ms2664 KiB
11Wrong answer3ms2784 KiB
subtask40/75
12Wrong answer3ms2788 KiB
13Wrong answer3ms2872 KiB
14Wrong answer3ms2836 KiB
15Wrong answer3ms2944 KiB
16Wrong answer3ms3072 KiB
17Wrong answer3ms3160 KiB
18Wrong answer3ms3156 KiB
19Wrong answer3ms3052 KiB
20Wrong answer3ms3160 KiB
21Wrong answer3ms3048 KiB