# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
222083 | Vimmer | Elder (COCI19_elder) | C++14 | 5 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |