# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
157573 | dcj | Elder (COCI19_elder) | C++14 | 2 ms | 380 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;
char Z1, Z2, p;
int N, br=0, v[30];
int main()
{
cin >> p;
cin >> N;
v[p - 'A'] = 1;
for (int i=1; i<=N;i++) {
cin >> Z1 >> Z2;
if (Z2==p) {
v[Z1 - 'A']=1;
p=Z1;
}
}
for (int i=0;i<=26;i++)
br+=v[i];
cout << p << endl;
cout << br;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |