# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
444744 | ics0503 | Chameleon's Love (JOI20_chameleon) | C++17 | 54 ms | 292 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "chameleon.h"
#include <vector>
using namespace std;
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) 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);
}
void Solve(int n) {
int i, j;
for (i = 1; i <= n; i++) {
vector<int>Y;
for (j = n + 1; j <= n + n; j++)Y.push_back(j);
S4(i, Y, n);
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |