QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#799092 | #8056. Travel 2 | 123adad | WA | 1ms | 3700kb | C++23 | 918b | 2024-12-04 21:55:01 | 2024-12-04 21:55:01 |
Judging History
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){
int now=(int)e[u].size()-1;
if(now<d[u]){
now++;int x;
cout<<"> "<<now<<endl;
cin>>x>>d[x];
e[u].push_back(x);
road[u][x]=now;
dfs(x);
return;
}
vis[u]=1;
for(int i=1;i<=now;i++){
if(!vis[i]){
int v=road[u][i];
int x;
cout<<"> "<<i<<endl;
cin>>x>>d[x];
dfs(v);
cout<<"> "<<road[v][u]<<endl;
cin>>x>>d[x];
}
}
}
void solve(){
for(int i=0;i<N;i++){
vis[i]=0;
e[i].clear();
e[i].push_back(0);
}
int u;
cin>>u>>d[u];
dfs(u);
cout<<"! ";
for(int i=1;i<N;i++){
for(auto v:e[i]){
if(i<v){
cout<<i<<" "<<v<<" ";
}
}
}
cout<<endl;
string s;cin>>s;
}
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: 1ms
memory: 3700kb
input:
2 1 1 2 1 1 1
output:
> 1 > 1 !
result:
wrong answer format Unexpected end of file - int32 expected (test case 1)