Submission #157572

#TimeUsernameProblemLanguageResultExecution timeMemory
157572dcjElder (COCI19_elder)C++14
20 / 50
2 ms376 KiB
#include <iostream> using namespace std; char Z1, Z2, p; int N, br=1, v[30]; int main() { cin >> p; cin >> N; v[p - 'A'] = 1; for (int i=1; i<=N;i++) { cin >> Z1 >> Z2; if (Z2==p) { v[Z1 - 'A']=1; p=Z1; } } for (int i=0;i<=26;i++) br+=v[i]; cout << p << endl; cout << br; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...