Submission #96668

#TimeUsernameProblemLanguageResultExecution timeMemory
96668OrtElder (COCI19_elder)C++11
50 / 50
2 ms376 KiB
#include<iostream> #include<vector> #include<set> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); char nosilac; cin >> nosilac; int n, cnt; cin >> n; char a, b; set<char> s; s.insert(nosilac); for(int i=0;i<n;i++) { cin >> a >> b; if(nosilac==b) { nosilac = a; s.insert(a); } } cout << nosilac << "\n" << s.size(); return 0; }

Compilation message (stderr)

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