| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1289240 | iq500 | 카멜레온의 사랑 (JOI20_chameleon) | C++20 | 0 ms | 0 KiB |
#include "chameleon.h"
#include <vector>
namespace {
int variable_example = 1;
} // namespace
void Solve(int N) {
bool cnt[2*N+1]={0};
vector<pair<int, int>> ans;
/*std::vector<int> p(3);
p[0] = 1;
p[1] = 2;
p[2] = 3;
variable_example = Query(p);
for (int i = 0; i < N; ++i) {
Answer(i * 2 + 1, i * 2 + 2);
}*/
for(int i=1; i<=2*N; i++){
if(cnt[i]) continue;
for(int j=i+1; j<=2*N; j++){
std::vector<int> q(2);
q[0]=i; q[1]=j;
int s=Query(q);
if(s==1){
cnt[i]=true;
cnt[j]=true;
ans.push_back(i, j);
break;
}
}
}
for(int i=0; i<N; i++){
Answer(ans[i].first, ans[i].second);
}
}
