# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96668 | Ort | Elder (COCI19_elder) | C++11 | 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>
#include<vector>
#include<set>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
char nosilac;
cin >> nosilac;
int n, cnt;
cin >> n;
char a, b;
set<char> s;
s.insert(nosilac);
for(int i=0;i<n;i++) {
cin >> a >> b;
if(nosilac==b) {
nosilac = a;
s.insert(a);
}
}
cout << nosilac << "\n" << s.size();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |