6862 | 2023-12-19 12:44:44 | kboti | Bolha a számegyenesen | cpp17 | Accepted 100/100 | 3ms | 3400 KiB |
#include <iostream>
using namespace std;
int main() {
int n,a=0;
cin>>n;
char t[n];
for (int i=0; i<n; i++)
{
cin>>t[i];
}
for (int i=0; i<n; i++)
{
if (t[i]=='L')
a--;
else
a++;
}
if (a<0)
a=a*(-1);
cout<<a;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1876 KiB | ||||
2 | Accepted | 3ms | 2124 KiB | ||||
subtask2 | 15/15 | ||||||
3 | Accepted | 3ms | 2204 KiB | ||||
4 | Accepted | 3ms | 2340 KiB | ||||
5 | Accepted | 3ms | 2416 KiB | ||||
6 | Accepted | 3ms | 2812 KiB | ||||
subtask3 | 10/10 | ||||||
7 | Accepted | 3ms | 2644 KiB | ||||
8 | Accepted | 3ms | 2768 KiB | ||||
9 | Accepted | 3ms | 2804 KiB | ||||
10 | Accepted | 3ms | 2864 KiB | ||||
11 | Accepted | 3ms | 2960 KiB | ||||
subtask4 | 75/75 | ||||||
12 | Accepted | 3ms | 3196 KiB | ||||
13 | Accepted | 3ms | 3180 KiB | ||||
14 | Accepted | 3ms | 3120 KiB | ||||
15 | Accepted | 3ms | 3120 KiB | ||||
16 | Accepted | 3ms | 3240 KiB | ||||
17 | Accepted | 3ms | 3352 KiB | ||||
18 | Accepted | 3ms | 3332 KiB | ||||
19 | Accepted | 3ms | 3400 KiB | ||||
20 | Accepted | 3ms | 3392 KiB | ||||
21 | Accepted | 3ms | 3392 KiB |