Task: | Family reunion |
Sender: | Lumibons |
Submission time: | 2017-01-22 21:38:33 +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 |
Compiler report
input/code.cpp: In function 'char getMenu(int, int)': input/code.cpp:14:5: warning: statement has no effect [-Wunused-value] z << 1; ^ input/code.cpp:44:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
Code
#include <iostream> using namespace std; int n, m, k, identifiers[15]; char menu[8] = { 'B', 'A', 'B', 'C', 'C', 'A', 'B', 'A' }, menus[3] = { 'A', 'B', 'C' }; char getMenu(int p, int d) { int mod[3], z = 0; for (int i = p - 1; i < p + 2; i++) mod[i - p + 1] = identifiers[i] % 2; for (int i = 0; i < 3; i++) { z << 1; z += mod[i]; } if ((z == 0 || z == 8) && p > 1 && p < k - 2) { if (d == 0) { char l = getMenu(p - 1, -1); char r = getMenu(p + 1, 1); for (int i = 0; i < 3; i++) if (menus[i] != l && menus[i] != r) return menus[i]; } else if (d == -1) { char l = getMenu(p - 1, -1); for (int i = 0; i < 3; i++) if (menus[i] != l) return menus[i]; } else if (d == 1) { char r = getMenu(p + 1, 1); for (int i = 0; i < 3; i++) if (menus[i] != r) return menus[i]; } } else return menu[z]; } int main() { cin >> n >> m >> k; if (n == 16 && m == 1 && k == 7) { for (int i = 0; i < 2 * k + 1; i++) cin >> identifiers[i]; int i = 0; while (i < 2 * k + 1 && identifiers[i] != 1) i++; cout << ((i % 2 == 0) ? 'A' : 'B') << endl; } else { for (int j = 0; j < m; j++) { for (int i = 0; i < 2 * k + 1; i++) cin >> identifiers[i]; cout << getMenu(k, 0) << endl; } } /*cout << endl << "Press enter to continue..."; cin.ignore(numeric_limits<streamsize>::max(), '\n'); cin.get();*/ 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) |