# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
423736 | tqbfjotld | 카멜레온의 사랑 (JOI20_chameleon) | C++14 | 3 ms | 456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "chameleon.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int p[505];
int inv[505];
vector<int> adjl[505];
}
void Solve(int N) {
for (int x = 1; x<=2*N; x++){
for (int y = x+1; y<=2*N; y++){
int res = Query({x,y});
if (res==1){
adjl[x].push_back(y);
adjl[y].push_back(x);
}
}
}
for (int x = 1; x<=2*N; x++){
if (adjl[x].size()==3){
int res1 = Query({x,adjl[x][0],adjl[x][1]});
int res2 = Query({x,adjl[x][1],adjl[x][2]});
int res3 = Query({x,adjl[x][0],adjl[x][2]});
if (res1==1){
p[x] = adjl[x][2];
}
else if (res2==1){
p[x] = adjl[x][0];
}
else{
p[x] = adjl[x][1];
}
inv[p[x]] = x;
}
}
for (int x = 1; x<=2*N; x++){
if (adjl[x].size()<3){
if (x<adjl[x][0]){
Answer(x,adjl[x][0]);
}
}
else{
int other = -1;
for (auto y : adjl[x]){
if (y==p[x]) continue;
if (y==inv[x]) continue;
other = y;
}
if (x<other){
Answer(x,other);
}
}
}
}
컴파일 시 표준 에러 (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... |