257252026-02-28 10:38:45algoproBolha a számegyenesencpp17Wrong answer 0/1001ms500 KiB
// UUID: c4a5a6ac-eba1-42f7-b73d-6a99570b4b2a
#include <bits/stdc++.h>
using namespace std;

int main() {
	string a; cin >> a;
    int pos = 0;

    for(int i = 0; i < a.size(); i++) {
        if(a[i] == 'R') {
            pos++;
        }
        else {
            pos--;
        }
    }

    if(pos < 0) {
        pos *= -1;
    }

    cout << pos;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms316 KiB
2Wrong answer1ms500 KiB
subtask20/15
3Wrong answer1ms316 KiB
4Wrong answer1ms316 KiB
5Wrong answer1ms316 KiB
6Wrong answer1ms316 KiB
subtask30/10
7Accepted1ms316 KiB
8Wrong answer1ms332 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms500 KiB
11Wrong answer1ms316 KiB
subtask40/75
12Wrong answer1ms500 KiB
13Wrong answer1ms316 KiB
14Wrong answer1ms316 KiB
15Wrong answer1ms316 KiB
16Wrong answer1ms316 KiB
17Wrong answer1ms316 KiB
18Wrong answer1ms316 KiB
19Wrong answer1ms316 KiB
20Wrong answer1ms320 KiB
21Wrong answer1ms316 KiB