Task: | Family reunion |
Sender: | Kaban-5 |
Submission time: | 2017-01-20 19:56:14 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | UNKNOWN | 0 |
#2 | UNKNOWN | 0 |
#3 | UNKNOWN | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | UNKNOWN | -- | 1 | details |
#2 | UNKNOWN | -- | 2 | details |
#3 | UNKNOWN | -- | 3 | details |
Code
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fst first #define snd second #define forn(i, n) for (int i = 0; i < int(n); ++i) typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef vector<pii> vii; #define sz(c) (int)(c).size() #define ALL(c) (c).begin(), (c).end() void solve (int n) { int m, k; cin >> m >> k; vi v(2 * k + 1); forn (i, sz(v)) { cin >> v[i]; v[i]--; } mt19937 rng; int c = -1; while (true) { c = rng() % (n - 1) + 1; if (__gcd(c, n) == 1) break; } int a = -1; if (n == 16) a = 9; else a = 20 * (rng() % (n / 20)) + 1; forn (i, sz(v)) v[i] = ((ll)a * (ll)v[i] + (ll)c) % n; int lst = -1; forn (i, sz(v) - 2) if (v[i] > v[i + 1]) lst = i; if (lst != -1) cout << (char)('A' + (lst % 3)) << '\n'; else cout << (char)('A' + (rng() % 3)) << '\n'; } int main() { #ifndef ONLINE_JUDGE //freopen("input.txt", "rt", stdin); //freopen("output.txt", "w", stdout); #endif // ONLINE_JUDGE ios_base::sync_with_stdio(false); cin.tie(0); int n; while (cin >> n) solve(n); }
Test details
Test 1
Group: 1
Verdict: UNKNOWN
input |
---|
#!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
correct output |
---|
50 |
user output |
---|
(not available) |
Test 2
Group: 2
Verdict: UNKNOWN
input |
---|
#!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
correct output |
---|
50 |
user output |
---|
(not available) |
Test 3
Group: 3
Verdict: UNKNOWN
input |
---|
#!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
correct output |
---|
50 |
user output |
---|
(not available) |