QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#657725#9484. Colored Complete Graphucup-team1004#WA 1ms3812kbC++17898b2024-10-19 15:21:032024-10-19 15:21:04

Judging History

你现在查看的是最新测评结果

  • [2024-10-19 15:21:04]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3812kb
  • [2024-10-19 15:21:03]
  • 提交

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3812kb

input:

3

output:

1 2

result:

wrong answer invalid question