67912023-12-19 10:04:15turitamasBolha a számegyenesencpp17Wrong answer 0/1003ms3312 KiB
#include <iostream>

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 answer3ms2068 KiB
subtask20/15
3Wrong answer3ms2276 KiB
4Wrong answer2ms2360 KiB
5Wrong answer2ms2376 KiB
6Wrong answer3ms2384 KiB
subtask30/10
7Wrong answer3ms2404 KiB
8Wrong answer3ms2476 KiB
9Wrong answer3ms2592 KiB
10Wrong answer3ms2744 KiB
11Wrong answer3ms2904 KiB
subtask40/75
12Wrong answer3ms3056 KiB
13Wrong answer3ms3072 KiB
14Wrong answer3ms3140 KiB
15Wrong answer3ms3128 KiB
16Wrong answer3ms3132 KiB
17Wrong answer3ms3056 KiB
18Wrong answer3ms3052 KiB
19Wrong answer3ms3120 KiB
20Wrong answer3ms3272 KiB
21Wrong answer3ms3312 KiB