QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#303747 | #5206. Hot and Cold | LaStataleBlue | WA | 1ms | 3792kb | C++23 | 2.1kb | 2024-01-12 22:36:32 | 2024-01-12 22:36:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int posx=12345,posy=0;
long long lastdist=0;
const bool debug = false;
const string UGUALE = "uguakjhgkjhle", VICINO = "vickjhgkjhgino", LONTANO = "lonkjhgkjhgtano";
void solve(int t){
const int n = 1'000'000;
auto query = [](int x,int y)->string{
cout<<x<<" "<<y<<endl;
string s;
if(!debug){
getline(cin,s);
}else{
long long dist = 1ll*(posx-x)*(posx-x)+1ll*(posy-y)*(posy-y);
if(dist==lastdist){
s = UGUALE;
}else if(dist<lastdist){
s = VICINO;
}else{
s = LONTANO;
}
cout<<s<<"\n";
lastdist=dist;
if(dist==0){
cout<<"ok\n";
exit(0);
}
}
if(s.back()=='!')exit(0);
return s;
};
map<string,int> val;
query(0,0);
string tmp1 = query(1,0);
string tmp3 = query(0,0);
string tmp2 = query(0,1);
if(tmp1==tmp2){
val[tmp2]=1;
val[tmp3]=-1;
}else{
query(n,0);
tmp3 = query(n-1,0);
val[tmp3]=1;
val[(tmp1!=tmp3 ? tmp1 : tmp2)]=-1;
}
int lx=0,rx=n+1,ly=0,ry=n+1;
if(debug){
cout<<"valori:\n";
for(auto [x,y] : val){
cout<<x<<" "<<y<<"\n";
}
cout<<"parto\n";
}
while(rx-lx>1 || ry-ly>1){
if(debug)cout<<"----------\n";
query(lx,ly);
string tmp1 = query(rx-1,ly);
string tmp2 = query(rx-1,ry-1);
int midx = (lx+rx)/2;
int midy = (ly+ry)/2;
if(val[tmp1]>=0){
lx=midx;
}else{
rx=midx;
}
if(val[tmp2]>=0){
ly=midy;
}else{
ry=midy;
}
}
query(lx,ly);
}
int main(){
int t=1;
//cin>>t;
for(int i=1;i<=t;i++)solve(i);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3520kb
input:
Tabilmadi Daha yakin Dalej Daha yakin Dalej 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 Daha yakin Dalej Daha yaki...
output:
0 0 1 0 0 0 0 1 0 0 1000000 0 1000000 1000000 0 0 499999 0 499999 499999 0 0 249999 0 249999 249999 0 0 124999 0 124999 124999 0 0 62499 0 62499 62499 0 0 31249 0 31249 31249 0 0 15624 0 15624 15624 0 0 7811 0 7811 7811 0 0 3905 0 3905 3905 0 0 1952 0 1952 1952 0 0 975 0 975 975 488 0 975 0 975 487 ...
result:
ok 61 points
Test #2:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
rr qq ww qq ww qq qq ww qq qq qq ww ww qq ww ww qq ww ww qq qq qq ww qq qq ww qq qq qq ww ww qq ww ww qq ww ww qq qq qq ww qq qq ww qq qq qq ww ww qq ww ww qq ee ee You are lucky today!
output:
0 0 1 0 0 0 0 1 0 0 1000000 0 1000000 1000000 500000 500000 1000000 500000 1000000 1000000 750000 750000 1000000 750000 1000000 1000000 750000 750000 874999 750000 874999 874999 750000 750000 812499 750000 812499 812499 750000 750000 781249 750000 781249 781249 765625 765625 781249 765625 781249 781...
result:
ok 56 points
Test #3:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
Tabilmadi Daha yakin Dalej Daha yakin Dalej 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 Daha yakin Daha yaki...
output:
0 0 1 0 0 0 0 1 0 0 1000000 0 1000000 1000000 0 0 499999 0 499999 499999 0 0 249999 0 249999 249999 0 0 124999 0 124999 124999 0 0 62499 0 62499 62499 0 0 31249 0 31249 31249 0 0 15624 0 15624 15624 0 0 7811 0 7811 7811 0 0 3905 0 3905 3905 0 0 1952 0 1952 1952 0 0 975 0 975 975 0 488 487 488 487 97...
result:
ok 61 points
Test #4:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
voyne net miru mir mir miru miru mir mir miru miru mir mir miru miru mir mir miru mir miru miru mir mir miru miru mir miru mir miru mir miru mir miru mir mir miru miru mir miru mir mir miru miru mir miru mir mir miru mir miru miru mir mir miru miru mir miru mir miru mir mir miru miru mir miru mir mi...
output:
0 0 1 0 0 0 0 1 0 0 1000000 0 1000000 1000000 500000 0 1000000 0 1000000 499999 500000 0 749999 0 749999 249999 500000 125000 624999 125000 624999 249999 562500 187500 624999 187500 624999 249999 562500 218750 593749 218750 593749 249999 562500 234375 578124 234375 578124 249999 562500 234375 570311...
result:
ok 64 points
Test #5:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir miru mir ...
output:
0 0 1 0 0 0 0 1 0 0 1000000 0 1000000 1000000 0 500000 499999 500000 499999 1000000 0 500000 249999 500000 249999 749999 125000 500000 249999 500000 249999 624999 187500 562500 249999 562500 249999 624999 218750 562500 249999 562500 249999 593749 234375 562500 249999 562500 249999 578124 234375 5625...
result:
ok 64 points
Test #6:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
mmimRRmmmmuiiuuiuimRmiiuiuiiuu mmimRRmmmmuiiuuiuimRmiiuiuiiuR mmimRRmmmmuiiuuiuimRmiiuiuiiui mmimRRmmmmuiiuuiuimRmiiuiuiiuR mmimRRmmmmuiiuuiuimRmiiuiuiiui mmimRRmmmmuiiuuiuimRmiiuiuiiui mmimRRmmmmuiiuuiuimRmiiuiuiiui mmimRRmmmmuiiuuiuimRmiiuiuiiuR mmimRRmmmmuiiuuiuimRmiiuiuiiuR mmimRRmmmmuiiuuiuimRm...
output:
0 0 1 0 0 0 0 1 0 0 1000000 0 1000000 1000000 0 0 499999 0 499999 499999 250000 250000 499999 250000 499999 499999 250000 250000 374999 250000 374999 374999 312500 312500 374999 312500 374999 374999 312500 312500 343749 312500 343749 343749 328125 328125 343749 328125 343749 343749 328125 328125 335...
result:
ok 58 points
Test #7:
score: 0
Accepted
time: 1ms
memory: 3792kb
input:
uiuumRmiRuRuRmmimuuummiRuiRumR uiuumRmiRuRuRmmimuuummiRuiRumi uiuumRmiRuRuRmmimuuummiRuiRumu uiuumRmiRuRuRmmimuuummiRuiRumi uiuumRmiRuRuRmmimuuummiRuiRumu uiuumRmiRuRuRmmimuuummiRuiRumi uiuumRmiRuRuRmmimuuummiRuiRumi uiuumRmiRuRuRmmimuuummiRuiRumi uiuumRmiRuRuRmmimuuummiRuiRumu uiuumRmiRuRuRmmimuuum...
output:
0 0 1 0 0 0 0 1 0 0 1000000 0 1000000 1000000 500000 500000 1000000 500000 1000000 1000000 500000 500000 749999 500000 749999 749999 625000 625000 749999 625000 749999 749999 625000 625000 687499 625000 687499 687499 656250 656250 687499 656250 687499 687499 656250 656250 671874 656250 671874 671874...
result:
ok 64 points
Test #8:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
RiRiiiimiRiiiuRuuRiRmuRiuRuRR!
output:
0 0
result:
ok 1 points
Test #9:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
imRRmiRiRiRuimuiRiiiumiiRRmRim RuRummmRRimumRimuRRiRuRuuiuRui mRmmmRmRRmiiuiummmuiiiuiRiRRmu RuRummmRRimumRimuRRiRuRuuiuRui mRmmmRmRRmiiuiummmuiiiuiRiRRmu RuRummmRRimumRimuRRiRuRuuiuRui iimumuiuRiiiiRmRmimuiRmiRRiRm!
output:
0 0 1 0 0 0 0 1 0 0 1000000 0 1000000 1000000
result:
ok 7 points
Test #10:
score: -100
Wrong Answer
time: 1ms
memory: 3568kb
input:
RiuimmRRRmmiimmiRuRRRmRiuimRum RiuimmRRRmmiimmiRuRRRmRiuimRuu RiuimmRRRmmiimmiRuRRRmRiuimRuR RiuimmRRRmmiimmiRuRRRmRiuimRuR RiuimmRRRmmiimmiRuRRRmRiuimRuu RiuimmRRRmmiimmiRuRRRmRiuimRuR RiuimmRRRmmiimmiRuRRRmRiuimRuR RiuimmRRRmmiimmiRuRRRmRiuimRuu RiuimmRRRmmiimmiRuRRRmRiuimRuR RiuimmRRRmmiimmiRuRRR...
output:
0 0 1 0 0 0 0 1 1000000 0 999999 0 0 0 1000000 0 1000000 1000000 0 500000 499999 500000 499999 1000000 0 750000 249999 750000 249999 1000000 0 875000 124999 875000 124999 1000000 0 937500 62499 937500 62499 1000000 0 968750 31249 968750 31249 1000000 0 984375 15624 984375 15624 1000000 0 992188 7811...
result:
wrong answer Used 64 points but did not win