QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#657725 | #9484. Colored Complete Graph | ucup-team1004# | WA | 1ms | 3812kb | C++17 | 898b | 2024-10-19 15:21:03 | 2024-10-19 15:21:04 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include"debug.h"
#else
#define debug(...) void()
#endif
#define all(x) (x).begin(),(x).end()
template<class T>
auto ary(T *a,int l,int r){
return vector<T>{a+l,a+1+r};
}
using ll=long long;
using ull=unsigned long long;
const int N=5e4+10;
int n;
vector<pair<int,int>>e[2];
int query(int i,int j){
printf("%d %d\n",i,j);
fflush(stdout);
static char res[6];
scanf("%s",res);
int op=*res=='R';
e[op].push_back({i,j});
return op;
}
int main(){
scanf("%d",&n);
vector<int>p[2];
for(int i=2;i<=n;i++){
p[query(1,i)].push_back(i);
}
int x=0,y=0;
for(;x<p[0].size()&&y<p[1].size();)(query(p[0][x],p[1][y])?y:x)++;
if(e[1].size()>e[0].size())swap(e[0],e[1]);
printf("!\n");
for(auto [u,v]:e[0])printf("%d %d\n",u,v);
fflush(stdout);
return 0;
}
#ifdef DEBUG
#include"debug.hpp"
#endif
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3812kb
input:
3
output:
1 2
result:
wrong answer invalid question