257232026-02-28 10:33:04algoproBolha a számegyenesencpp17Wrong answer 0/1001ms508 KiB
// UUID: 7c912c7b-34c3-4bf9-b9b7-8e2abb034800
#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 answer1ms508 KiB
5Wrong answer1ms316 KiB
6Wrong answer1ms316 KiB
subtask30/10
7Accepted1ms508 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