Task: | Family reunion |
Sender: | cuber2460 |
Submission time: | 2017-01-21 21:36:07 +0200 |
Language: | C++ |
Status: | READY |
Result: | 19 |
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
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int n, m, k; int t[107]; int res[107]; int A = 854971895; int B = 150918510; int per[100007]; int main() { ios_base::sync_with_stdio(0); srand(5718); cin >> n >> m >> k; for(int i = 0; i <= 2 * k; ++i) { cin >> t[i]; t[i]--; long long pom = t[i]; pom *= A; pom += B; pom %= n; t[i] = pom; } if(n <= 100000) { for(int i = 0; i < n; ++i) per[i] = i; random_shuffle(per, per + n); for(int i = 0; i <= 2 * k; ++i) t[i] = per[t[i]]; } for(int i = 0; i < 2 * k; ++i) { if(t[i] % 2 == 0 && t[i + 1] % 2 == 1) res[i] = 1; } if(res[k]) cout << 'A' << endl; else { int x = -10; int y = 2 * k + 10; for(int i = 0; i < k; ++i) if(res[i]) x = i; for(int i = 2 * k; i > k; --i) if(res[i]) y = i; y = y - k; x = k - x; if(y < x) { if(y + 1 == x) cout << 'C' << endl; else { if(y % 2 == 1) cout << 'B' << endl; else cout << 'A' << endl; } } else { if(x % 2 == 1) cout << 'B' << endl; else cout << 'A' << endl; } } return 0; }
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) |