Submission #100972

# Submission time Handle Problem Language Result Execution time Memory
100972 2019-03-15T15:20:45 Z KLPP Elder (COCI19_elder) C++14
50 / 50
4 ms 384 KB
#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
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 4 ms 256 KB Output is correct
5 Correct 3 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 3 ms 384 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 3 ms 384 KB Output is correct