QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#688884#9484. Colored Complete Graph__jk__#WA 1ms3768kbC++141020b2024-10-30 14:08:172024-10-30 14:08:17

Judging History

This is the latest submission verdict.

  • [2024-10-30 14:08:17]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3768kb
  • [2024-10-30 14:08:17]
  • Submitted

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