Task: | Family reunion |
Sender: | cuber2460 |
Submission time: | 2017-01-21 20:53:00 +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> using namespace std; int n, m, k; int t[107]; char res[107]; int A = 854971895; int B = 150918510; 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; } for(int i = 1; i < 2 * k; ++i) { if(t[i] > t[i - 1] && t[i] > t[i + 1]) res[i] = 'A'; if(t[i] < t[i - 1] && t[i] < t[i + 1]) res[i] = 'B'; } for(int i = 1; i < 2 * k; ++i) { if(!res[i]) { if(t[i - 1] < t[i]) { if(res[i - 1] == 'B') { if(res[i + 1] == 'A') res[i] = 'C'; else res[i] = 'A'; } else if(res[i - 1] == 'A') { res[i] = 'B'; } } } } for(int i = 2 * k - 1; i > 0; --i) { if(!res[i]) { if(t[i + 1] < t[i]) { if(res[i + 1] == 'B') { if(res[i - 1] == 'A') res[i] = 'C'; else res[i] = 'A'; } else if(res[i + 1] == 'A') { res[i] = 'B'; } } } } if(!res[k]) res[k] = 'A' + (rand() % 3); cout << res[k] << 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) |