# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
157577 | ToniB | Elder (COCI19_elder) | C++14 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
// int a[95];
int v[30], N, br;
char sol, x, y;
int main()
{
cin >> sol;
v[sol - 'A'] = 1;
cin >> N;
for (int i = 0; i < N; ++i){
cin >> x >> y;
if (y == sol){
sol = x;
v[x - 'A'] = 1;
}
}
cout << sol << endl;
for(int i = 0; i < 26; ++i)
br += v[i];
cout << br;
return 0;
}
/*
X
4
A X
B X
X A
D A
N
5
D A
N B
B A
C D
F A
*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |