QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#799074#8056. Travel 2123adadWA 0ms3748kbC++23879b2024-12-04 21:36:322024-12-04 21:36:33

Judging History

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

  • [2024-12-04 21:36:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3748kb
  • [2024-12-04 21:36:32]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int N=2510;
int d[N],vis[N],road[N][N];
vector<int> e[N];
void dfs(int u){
	if(e[u].size()<d[u]){
		cout<<"> "<<e[u].size()+1<<endl;
		int v;
		cin>>v>>d[v];
		e[u].push_back(v);
		road[u][v]=e[u].size()+1;
		dfs(v);
		return;
	}
	vis[u]=1;
	int i=0;
	for(auto v:e[u]){
		i++;
		if(!vis[v]){
			cout<<"> "<<i<<endl;
			cin>>i;
			cin>>d[i];
			dfs(v);
			int x=road[v][u];
			cout<<"> "<<x<<endl;
			cin>>x;
			cin>>d[x];
		}
	}
}
void solve(){
	for(int i=0;i<N;i++){
		vis[i]=0;
		e[i].clear();
	}
	int u;
	cin>>u>>d[u];
	dfs(u);
	cout<<"! ";
	for(int u=1;u<N;u++){
		for(auto v:e[u]){
			if(u<v){
				cout<<u<<" "<<v<<" ";
			}
		}
	}
	cout<<endl;
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0);
	int _=1;//cin>>_;
	while(_--) solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
1 1
2 1
1 1

output:

> 1
> 1
! 

result:

wrong answer format  Unexpected end of file - int32 expected (test case 1)