QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#664702#7156. Find the BoxWarinchai_s#0 1ms3656kbC++14872b2024-10-21 21:49:542024-10-21 21:49:56

Judging History

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

  • [2024-10-21 21:49:56]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3656kb
  • [2024-10-21 21:49:54]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
mt19937 rng(time(NULL));
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int h,w;cin>>h>>w;
    int x=0,y=0;
    int t=0;
    vector<pair<int,int>>v;
    for(int i=0;i<h;i++){
        v.push_back({rng(),i});
    }
    sort(v.begin(),v.end());
    for(int ii=0;ii<h;ii++){
        t++;
        int i=v[ii].second;
        cout<<"? ";
        for(int j=0;j<i;j++){
            cout<<"v";
        }
        for(int j=0;j<w;j++){
            cout<<">";
        }
        cout<<endl;
        int r,c;cin>>r>>c;
        if(r!=i){
            y=0,x=r+1;
            break;
        }
        if(c!=w-1){
            y=c+1;
            x=i;
            break;
        }
    }
    assert(t<=2500);
    cout<<"! "<<x<<' '<<y<<endl;
}
/*
4 5
1
1 1
1 1 1
4
4 4
4 4 4

*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Acceptable Answer
time: 1ms
memory: 3656kb

input:

4 5
1 4
0 4
2 2

output:

? v>>>>>
? >>>>>
? vv>>>>>
! 2 3

result:

points 0.820 0.82 used 3 queried; score: 82.00