Submission #157577

#TimeUsernameProblemLanguageResultExecution timeMemory
157577ToniBElder (COCI19_elder)C++14
50 / 50
2 ms376 KiB
#include <iostream> using namespace std; // int a[95]; int v[30], N, br; char sol, x, y; int main() { cin >> sol; v[sol - 'A'] = 1; cin >> N; for (int i = 0; i < N; ++i){ cin >> x >> y; if (y == sol){ sol = x; v[x - 'A'] = 1; } } cout << sol << endl; for(int i = 0; i < 26; ++i) br += v[i]; cout << br; return 0; } /* X 4 A X B X X A D A N 5 D A N B B A C D F A */
#Verdict Execution timeMemoryGrader output
Fetching results...