# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293380 | 7_7_7 | Elder (COCI19_elder) | C++17 | 1 ms | 392 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 <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
char x, a, b;
int n, cnt = 1;
cin >> x >> n;
map<char, int> used;
used[x] = 1;
for(int i = 1; i <= n; i ++){
cin >> a >> b;
if(b == x){
x = a;
used[x] = 1;
}
}
cout << x << "\n" << (int)used.size() << "\n";
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |