257222026-02-28 10:31:17algoproBolha a számegyenesencpp17Wrong answer 0/1001ms508 KiB
// UUID: def3c94d-405a-49c9-b1a0-839c27c24101
#include <bits/stdc++.h>
using namespace std;

int main() {
	string s;
	cin >> s;
	int x = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'L') {
			x--;
		} else {
			x++;
		}
	}
	if (x == 0) {
		cout << 0;
	} else if (x > 0) {
		cout << x;
	} else {
		cout << 0 - x;
	}
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms316 KiB
2Wrong answer1ms316 KiB
subtask20/15
3Wrong answer1ms316 KiB
4Wrong answer1ms316 KiB
5Wrong answer1ms316 KiB
6Wrong answer1ms508 KiB
subtask30/10
7Accepted1ms316 KiB
8Wrong answer1ms316 KiB
9Wrong answer1ms508 KiB
10Wrong answer1ms316 KiB
11Wrong answer1ms316 KiB
subtask40/75
12Wrong answer1ms316 KiB
13Wrong answer1ms508 KiB
14Wrong answer1ms316 KiB
15Wrong answer1ms316 KiB
16Wrong answer1ms508 KiB
17Wrong answer1ms508 KiB
18Wrong answer1ms316 KiB
19Wrong answer1ms316 KiB
20Wrong answer1ms316 KiB
21Wrong answer1ms316 KiB