Submission #293380

#TimeUsernameProblemLanguageResultExecution timeMemory
2933807_7_7Elder (COCI19_elder)C++17
50 / 50
1 ms392 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); char x, a, b; int n, cnt = 1; cin >> x >> n; map<char, int> used; used[x] = 1; for(int i = 1; i <= n; i ++){ cin >> a >> b; if(b == x){ x = a; used[x] = 1; } } cout << x << "\n" << (int)used.size() << "\n"; }

Compilation message (stderr)

elder.cpp: In function 'int main()':
elder.cpp:10:12: warning: unused variable 'cnt' [-Wunused-variable]
   10 |     int n, cnt = 1;
      |            ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...