Submission #222083

#TimeUsernameProblemLanguageResultExecution timeMemory
222083VimmerElder (COCI19_elder)C++14
50 / 50
5 ms384 KiB
#include <bits/stdc++.h> //#pragma GCC optimize("unroll-loops") //#pragma GCC optimize("-O3") //#pragma GCC optimize("Ofast") //#pragma GCC optimize("fast-math") //#pragma GCC optimize("no-stack-protector") #define F first #define S second #define sz(x) int(x.size()) #define pb push_back #define N 300005 #define MOD ll(998244353) using namespace std; typedef long long ll; typedef long double ld; int main() { ios_base::sync_with_stdio(0); istream::sync_with_stdio(0); cin.tie(0); cout.tie(0); char c; cin >> c; int n; cin >> n; set <char> se; se.clear(); se.insert(c); for (int i = 0; i < n; i++) { char z1, z2; cin >> z1 >> z2; if (z2 == c) {se.insert(z1); c = z1;} } cout << c << endl << sz(se); }
#Verdict Execution timeMemoryGrader output
Fetching results...