QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#469076 | #5206. Hot and Cold | cyc001 | WA | 1ms | 3552kb | C++23 | 1.3kb | 2024-07-09 13:11:48 | 2024-07-09 13:11:49 |
Judging History
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){
cout<<x<<' '<<y<<'\n';
cout.flush();
string res;
cin>>res;
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;
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: 3552kb
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