# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
444748 | 2021-07-15T04:39:52 Z | ics0503 | 카멜레온의 사랑 (JOI20_chameleon) | C++17 | 51 ms | 332 KB |
#include "chameleon.h" #include <vector> using namespace std; int cck[1212]; void validation(int n, int i, int j) { vector<int>qr; for (int p = 1; p <= 2 * n; p++) { if (i == p || j == p)continue; qr.push_back(p); } int Q = Query(qr); if (Q != n) { cck[i] = cck[j] = 1; Answer(i, j); } } void S4(int who, vector<int>Y,int n) { int sz = Y.size(), i, j; if (sz == 1) { validation(n, who, Y[0]); return; } vector<int>L, R; for (i = 0; i < sz / 2; i++)L.push_back(Y[i]); for (i = sz/2; i < sz; i++)R.push_back(Y[i]); L.push_back(who); R.push_back(who); int a = Query(L); int b = Query(R); L.pop_back(); R.pop_back(); if (a != L.size() + 1)S4(who, L, n); if (b != R.size() + 1)S4(who, R, n); } vector<int>AX, AY; int pk[1212]; void Solve(int n) { int i, j; pk[1] = 1; for (i = 2; i <= 2 * n; i++) { vector<int>X, Y; for (j = 1; j <= 2 * n; j++) { if (i == j) { X.push_back(j); continue; } if (pk[j])X.push_back(j); else Y.push_back(j); } int a = Query(X); int b = Query(Y); Y.push_back(i); int c = Query(Y); if (a == X.size() && b == c) { pk[i] = 1; } } for (i = 1; i <= 2 * n; i++) { if (pk[i])AX.push_back(i); else AY.push_back(i); } for (i = 0; i < n; i++) { int who = AX[i]; vector<int>Y; for (j = 0; j < n; j++) { int v = AY[j]; if (cck[v])continue; Y.push_back(v); } S4(who, Y, n); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Correct | 0 ms | 200 KB | Output is correct |
3 | Correct | 44 ms | 316 KB | Output is correct |
4 | Correct | 43 ms | 328 KB | Output is correct |
5 | Correct | 46 ms | 320 KB | Output is correct |
6 | Correct | 51 ms | 304 KB | Output is correct |
7 | Correct | 46 ms | 332 KB | Output is correct |
8 | Correct | 50 ms | 312 KB | Output is correct |
9 | Correct | 44 ms | 332 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Incorrect | 0 ms | 200 KB | Wrong Answer [1] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Incorrect | 0 ms | 200 KB | Wrong Answer [1] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Incorrect | 0 ms | 200 KB | Wrong Answer [1] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Correct | 0 ms | 200 KB | Output is correct |
3 | Correct | 44 ms | 316 KB | Output is correct |
4 | Correct | 43 ms | 328 KB | Output is correct |
5 | Correct | 46 ms | 320 KB | Output is correct |
6 | Correct | 51 ms | 304 KB | Output is correct |
7 | Correct | 46 ms | 332 KB | Output is correct |
8 | Correct | 50 ms | 312 KB | Output is correct |
9 | Correct | 44 ms | 332 KB | Output is correct |
10 | Correct | 0 ms | 200 KB | Output is correct |
11 | Incorrect | 0 ms | 200 KB | Wrong Answer [1] |
12 | Halted | 0 ms | 0 KB | - |