QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#688884 | #9484. Colored Complete Graph | __jk__# | WA | 1ms | 3768kb | C++14 | 1020b | 2024-10-30 14:08:17 | 2024-10-30 14:08:17 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define x first
#define y second
#define pb push_back
using namespace std;
using pii=pair <int,int>;
void solve(){
int n;
cin>>n;
vector <pair <int,int> > er,eb;
vector <int> r,b;
for (int i=2; i<=n; i++){
cout<<"? 1 "<<i<<endl;
char c; cin>>c;
if (c=='R') er.pb({1,i}),r.pb(i);
else eb.pb({1,i}),b.pb(i);
}
int px=0,py=0;
while (px<r.size()&&py<b.size()){
cout<<"? "<<r[px]<<' '<<b[py]<<endl;
char c; cin>>c;
if (c=='R'){
er.pb({r[px],b[py]});
py++;
} else {
eb.pb({b[px],b[py]});
px++;
}
}
cout<<'!'<<endl;
if (er.size()==n-1){
for (pii i:er) cout<<i.x<<' '<<i.y<<endl;
} else {
for (pii i:eb) cout<<i.x<<' '<<i.y<<endl;
}
}
signed main(){
//ios_base::sync_with_stdio(0); cin.tie(0);
int t=1;
//cin>>t;
while (t--) solve();
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3768kb
input:
3 B R B
output:
? 1 2 ? 1 3 ? 3 2 ! 1 2 2 2
result:
wrong answer guessed graph is incorrect