# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
119259 | Rubanov | Elder (COCI19_elder) | C++17 | 3 ms | 384 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>
#define ll long long
#define f first
#define s second
using namespace std;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
char a;
int n,cnt=1;
cin>>a>>n;
bool us[260]={};
us[a]=1;
while (n--) {
char z1,z2;
cin>>z1>>z2;
if (a==z2) {
a = z1;
if (!us[a])
cnt++;
us[a]=1;
}
}
cout<<a<<'\n'<<cnt;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |