QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#469079#5206. Hot and Coldcyc001WA 1ms3616kbC++231.4kb2024-07-09 13:13:412024-07-09 13:13:41

Judging History

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

  • [2024-07-09 13:13:41]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3616kb
  • [2024-07-09 13:13:41]
  • 提交

answer

#include<bits/stdc++.h>
#if not defined(ONLINE_JUDGE)
    std::string Ask(int,int);
#endif
#define cir(i,a,b) for(int i=a;i<b;++i)
using namespace std;

#if not defined(__GRADER_H) && defined(ONLINE_JUDGE)

#define __GRADER_H 1

extern void findTreasure();

string Ask(int x,int y){
    cerr<<"Ask:"<<x<<' '<<y<<" Result=";
    cout<<x<<' '<<y<<'\n';
    cout.flush();
    string res;
    cin>>res;
    cerr<<res<<'\n';
    if(find(res.begin(),res.end(),'!')!=res.end()) exit(0);
    return res;
}

int main(){
    ios::sync_with_stdio(false),cin.tie(0);
    findTreasure();
    return 0;
}

#endif

static constexpr auto maxrng=(int)(1e6);

void findTreasure(){
    Ask(0,0);
    const auto strlf=Ask(1,1);
    Ask(maxrng,maxrng);
    const auto strrg=Ask(maxrng-1,maxrng-1);
    if(strlf!=strrg){
        cir(dxi,0,2) cir(dyi,0,2){
            Ask(dxi,dyi);
            Ask(maxrng-dxi,maxrng-dyi);
        }
        // abort();
    }
    const auto closer=strlf;
    cerr<<"CLOSER="<<closer<<'\n';
    auto xl=0,xr=maxrng,yl=0,yr=maxrng;
    cir(i,0,20){
        if(xl==xr&&yl==yr) break;
        const auto xmid=midpoint(xl,xr);
        const auto ymid=midpoint(yl,yr);
        Ask(xmid,ymid);
        Ask(xmid+1,ymid)==closer?xl=xmid+1:xr=xmid-1;
        Ask(xmid+1,ymid+1)==closer?yl=ymid+1:yr=ymid-1;
    }
    Ask(xl,yl);
    Ask(xl,yl+1);
    Ask(xl+1,yl);
    Ask(xl+1,yl+1);
    // abort();
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3616kb

input:

Tabilmadi
Daha yakin
Dalej
Daha yakin
Daha yakin
Dalej
Daha yakin
Dalej
Daha yakin
Dalej
Daha yakin
Dalej
Daha yakin
Dalej
Dalej
Daha yakin
Dalej
Dalej
Daha yakin
Dalej
Dalej
Daha yakin
Dalej
Dalej
Dalej
Dalej
Dalej
Daha yakin
Dalej
Dalej
Daha yakin
Dalej
Dalej
Daha yakin
Dalej
Dalej
Daha yakin
Dale...

output:

0 0
1 1
1000000 1000000
999999 999999
0 0
1000000 1000000
0 1
1000000 999999
1 0
999999 1000000
1 1
999999 999999
500000 500000
500001 500000
500001 500001
249999 249999
250000 249999
250000 250000
124999 124999
125000 124999
125000 125000
62499 62499
62500 62499
62500 62500
93749 31249
93750 31249
...

result:

wrong answer Used 64 points but did not win