QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#719184#8056. Travel 2FHQY#WA 0ms3664kbC++20966b2024-11-06 23:09:282024-11-06 23:09:29

Judging History

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

  • [2024-11-06 23:09:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3664kb
  • [2024-11-06 23:09:28]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define ll long long
using namespace std;
const ll maxn=2505,maxm=1e4+5;
ll tot;
pair<ll,ll>gt(ll x){
	ll res=0,siz=0;
	cout<<"> "<<x<<endl;
	cin>>res>>siz;
	return make_pair(res,siz);
	tot++;
}
ll e[maxn][maxn];
vector<ll>lst[maxn];
ll cur[maxn];
void dfs(ll x,ll siz,ll fa){
	if(e[x][fa]){
		gt(e[x][fa]);
		return ;
	}
	while(cur[x]<=siz){
		pair<ll,ll>res=gt(cur[x]);
		e[x][res.first]=cur[x];
		lst[x].push_back(res.first);
		cur[x]++;
		dfs(res.first,res.second,x);
	}
	return ;
}
void solve()
{
	tot=0;
	for(ll i=1;i<=2500;i++){
		cur[i]=1;
		for(auto it:lst[i])e[i][it]=0;
		lst[i].clear();
	}
	ll x=0,siz=0;
	cin>>x>>siz;
	dfs(x,siz,0);
	cout<<"! ";
	for(ll i=1;i<=2500;i++){
		if(lst[i].empty())continue;
		for(auto it:lst[i]){
			if(i<it)cout<<i<<" "<<it<<" ";
		}
	}
	cout<<endl;
	return ;
}

signed main()
{
	int T;
	cin>>T;
	while(T--)
		solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3664kb

input:

2
1 1
2 1
1 1
2 1
Correct
1 3

output:

> 1
> 1
> 1
! 1 2 
> 0
! 

result:

wrong answer Integer parameter [name=i] equals to 0, violates the range [1, 3] (test case 2)