#include #include #include #include #include #include using namespace std; int Q, a[200], b[100]; bool used[100]; vectorB; int Debug = 1; tuple Get(vectorV) { if (Debug == 0) { int c[3] = { 0,0,0 }; for (int i = 0; i < 100; i++) { string U = to_string(b[i]); if (U.size() == 1)U = "0" + U; int cnt = 0; if (U[0] == V[i][0])cnt++; if (U[1] == V[i][1])cnt++; c[cnt]++; } return make_tuple(c[0], c[1], c[2]); } if (Debug == 1) { for (int i = 0; i < 100; i++) { if (i)cout << " "; cout << V[i]; } cout << endl; int V1, V2, V3; cin >> V1 >> V2 >> V3; return make_tuple(V1, V2, V3); } } void query(int l, int r, int p, int x, int rec, vectorG) { if (l == r) { B.push_back(G[l]); return; } vector R1, R2; for (int i = 0; i < 100; i++) { R1.push_back("??"); } int m = (l + r) / 2; for (int i = G[l]; i <= G[m]; i++) { if (p == 0) R1[i][0] = (char)('0' + x); if (p == 1) R1[i][1] = (char)('0' + x); } tupleA = Get(R1); int sums = get<1>(A) + get<2>(A) * 2; if (sums >= 1) query(l, m, p, x, sums, G); if (rec - sums >= 1)query(m + 1, r, p, x, rec - sums, G); } void makerand() { bool uu[100]; for (int i = 0; i < 100; i++)uu[i] = false; for (int j = 0; j < 100; j++) { while (true) { int H = rand() % 100; if (uu[H] == false) { b[j] = H; uu[H] = true; break; } } } } int main() { srand((unsigned)time(NULL)); cin >> Q; makerand(); for (int i = 0; i < 200; i++)a[i] = 9; for (int i = 0; i < 2; i++) { for (int j = 0; j < 100; j++)used[j] = false; for (int j = 0; j < 9; j++) { vectorJ; for (int k = 0; k < 100; k++) { if (used[k] == false)J.push_back(k); } B.clear(); query(0, J.size() - 1, i, j, 10, J); for (int k = 0; k < B.size(); k++) { used[B[k]] = true; a[B[k] * 2 + i] = j; } } } for (int i = 0; i < 200; i++) { if (i >= 2 && i % 2 == 0)cout << " "; cout << a[i]; } cout << endl; int V1, V2, V3; cin >> V1 >> V2 >> V3; return 0; }