65712023-12-12 09:55:42GervidBolha a számegyenesencpp17Accepted 100/1003ms3968 KiB
#include <iostream>

using namespace std;

int main()
{
	int i, n, coord = 0;
	cin >> n;

    char current;

	for (i = 0; i < n; i++)
	{
		cin >> current;

		if (current == 'L')
		{
			coord--;
		}
		else
		{
			coord++;
		}
	}

	cout << abs(coord);
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1876 KiB
2Accepted3ms2124 KiB
subtask215/15
3Accepted3ms2520 KiB
4Accepted3ms2380 KiB
5Accepted3ms2620 KiB
6Accepted3ms2836 KiB
subtask310/10
7Accepted3ms2868 KiB
8Accepted3ms2868 KiB
9Accepted3ms2896 KiB
10Accepted3ms2836 KiB
11Accepted3ms2968 KiB
subtask475/75
12Accepted3ms3052 KiB
13Accepted3ms3048 KiB
14Accepted3ms3056 KiB
15Accepted3ms3188 KiB
16Accepted3ms3416 KiB
17Accepted3ms3664 KiB
18Accepted3ms3720 KiB
19Accepted3ms3968 KiB
20Accepted3ms3936 KiB
21Accepted3ms3936 KiB