# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100972 | KLPP | Elder (COCI19_elder) | C++14 | 4 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>
using namespace std;
typedef long long int lld;
int main(){
bool obey[26];
for(int i=0;i<26;i++)obey[i]=false;
char c;
cin>>c;
int C=c-'A';
obey[C]=true;
int n;
cin>>n;
for(int i=0;i<n;i++){
char x,y;
cin>>x>>y;
if(y==c){
c=x;
C=x-'A';
obey[C]=true;
}
}
int ans=0;
for(int i=0;i<26;i++)ans+=obey[i];
cout<<c<<endl<<ans<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |