Submission #116785

#TimeUsernameProblemLanguageResultExecution timeMemory
116785ioilolcomElder (COCI19_elder)C++14
50 / 50
2 ms384 KiB
#include <bits/stdc++.h> using namespace std; #define endl "\n" typedef long long int ll; set<int> lol; int main() { ios_base:: sync_with_stdio(false); cin.tie(0); char c; cin>>c; int n; cin>>n; int cnt=1; lol.insert(c); for(int i=1; i<=n; i++) { char a,b; cin>>a>>b; if(b==c) { c=a; lol.insert(c); } } cout<<c<<endl; cout<<(int)lol.size()<<endl; return 0; }

Compilation message (stderr)

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