QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#331672 | #5206. Hot and Cold | Kevin5307# | WA | 1ms | 3588kb | C++23 | 2.0kb | 2024-02-18 16:56:05 | 2024-02-18 16:56:05 |
Judging History
answer
//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
bool firstTime;
string Closer,Further,Same;
int lstx;
int lsty;
string go(int x,int y)
{
lstx=x;
lsty=y;
if(!firstTime)
{
firstTime=1;
cout<<x<<" "<<y<<endl;
string s;
getline(cin,s);
if(s.back()=='!') exit(0);
return s;
}
cout<<x<<" "<<y<<endl;
string s;
getline(cin,s);
if(s.back()=='!') exit(0);
if(s==Closer) return "Closer_";
if(s==Further) return "Further_";
if(s==Same) return "Same_";
if(sz(Closer)&&sz(Further)) return "Same_";
if(sz(Further)&&sz(Same)) return "Closer_";
if(sz(Same)&&sz(Closer)) return "Further_";
return s;
}
const int M=1000000;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
go(0,0);
string A=go(0,1);
go(0,0);
string B=go(1,0);
if(A==B)
{
Closer=A;
go(M/2,M/2);
string C=go(M/2,M/2+1);
if(C!="Closer_")
Further=C;
else
Further=go(M/2,M/2-1);
}
else
{
go(M,0);
Closer=go(M-1,0);
if(A==Closer) Further=B;
else Further=A;
}
int lx=0,rx=M;
int ly=0,ry=M;
while(lx<rx||ly<ry)
{
int midx=(lx+rx)/2;
int midy=(ly+ry)/2;
go(midx,midy);
string state=go(midx,midy+1);
if(state=="Further_")
ry=midy;
else
ly=midy+1;
state=go(midx+1,midy+1);
if(state=="Further_")
rx=midx;
else
lx=midx+1;
}
go(lx,ly);
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3588kb
input:
Tabilmadi Daha yakin Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dalej Daha yakin Dalej Dah...
output:
0 0 0 1 0 0 1 0 500000 500000 500000 500001 500000 500000 500000 500001 500001 500001 250000 250000 250000 250001 250001 250001 125000 125000 125000 125001 125001 125001 62500 62500 62500 62501 62501 62501 31250 31250 31250 31251 31251 31251 15625 15625 15625 15626 15626 15626 7812 7812 7812 7813 78...
result:
wrong answer Used 64 points but did not win