# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
157562 | dcj | 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 main()
{
char Z1, Z2, p;
int N, br=1,u;
cin >> p;
cin >> N;
int v[28];
v[(int)p - 'A'] = 1;
for (int i=1; i<=N;i++) {
scanf("%c %c", Z1, Z2);
if (Z2==p) {
v[(int)Z1 - 'A']=1;
p=Z1;
}
}
for (int i=0;i<=26;i++) {
if (v[i]==1)
br++;
}
cout << p;
cout << br;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |