257272026-02-28 10:43:28algoproBolha a számegyenesencpp17Wrong answer 0/1001ms508 KiB
// UUID: 2b6e5b49-fa50-4b88-8911-3be8041d5af7
#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 -1;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Wrong answer1ms316 KiB
subtask20/15
3Wrong answer1ms316 KiB
4Wrong answer1ms316 KiB
5Accepted1ms316 KiB
6Accepted1ms364 KiB
subtask30/10
7Wrong answer1ms316 KiB
8Wrong answer1ms316 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms316 KiB
11Wrong answer1ms316 KiB
subtask40/75
12Wrong answer1ms316 KiB
13Wrong answer1ms316 KiB
14Wrong answer1ms316 KiB
15Wrong answer1ms316 KiB
16Wrong answer1ms316 KiB
17Wrong answer1ms316 KiB
18Wrong answer1ms316 KiB
19Wrong answer1ms508 KiB
20Wrong answer1ms316 KiB
21Wrong answer1ms316 KiB