QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#511236#5206. Hot and ColdjakerWA 1ms3800kbC++202.4kb2024-08-09 17:54:272024-08-09 17:54:31

Judging History

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

  • [2024-08-09 17:54:31]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3800kb
  • [2024-08-09 17:54:27]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i = j;i <= k;++i)
#define repp(i,j,k) for(int i = j;i >= k;--i)
string closer,further;
string tmp,tmp1;
void output(int x,int y) {
    cout<<x<<" "<<y<<endl;
}
void check(string s) {
    if(s[s.length()-1] == '!')
        exit(0);
}
void work(int x1,int x2,int y1,int y2) {
    if( x2 - x1 <= 1 && y2 - y1 <= 1 ) {
        output(x1,y1); getline(cin,tmp); check(tmp);
        output(x1,y2); getline(cin,tmp); check(tmp);
        output(x2,y1); getline(cin,tmp); check(tmp);
        output(x2,y2); getline(cin,tmp); check(tmp);
        // assert(0);
        return;
    }
    int midx = (x1+x2)/2 , midy = (y1+y2)/2;
    output(midx,midy);
    getline(cin,tmp); check(tmp);
    output(midx+1,midy);
    getline(cin,tmp); check(tmp);
    output(midx+1,midy+1);
    getline(cin,tmp1);; check(tmp1);

    int x1_n,x2_n,y1_n,y2_n;
    if( tmp == closer )
        x1_n = midx + 1, x2_n = x2;
    else 
        x1_n = x1 , x2_n = midx;
    if( tmp1 == closer )
        y1_n = midy + 1 , y2_n = y2;
    else 
        y1_n = y1 , y2_n = midy;
    work(x1_n,x2_n,y1_n,y2_n);
}
void work1(int l,int r) {
    printf("#%d %d\n",l,r);
    if( r-l <= 2 ) {
        rep(i,l,r) {
            output(0,i);
            getline(cin,tmp); check(tmp);
            output(i,0);
            getline(cin,tmp); check(tmp);
        }
        assert(0);
        return;
    }
    int mid = (l+r)>>1 , midd = mid>>1;
    output(midd,midd);
    getline(cin,tmp); check(tmp);
    output(midd+1,midd+1);
    getline(cin,tmp); check(tmp);
    if( tmp == closer ) {
        work1(mid,r);
    }
    else {
        if( tmp == further )
            work1(l,mid);
        else {
            output(0,2*midd+1);
            getline(cin,tmp); check(tmp);
            output(0*midd+1,0);
            getline(cin,tmp); check(tmp);
        }
    }
}
signed main(){
    output(0,0);
    
    getline(cin,tmp); check(tmp);
    output(0,1);
    getline(cin,closer); check(closer);
    output(0,0);
    getline(cin,tmp); check(tmp);
    output(1,0);
    getline(cin,tmp); check(tmp);
    if( tmp == closer ) work(1,1000000,1,1000000);
    else {
        output(1000000,1000000);
        getline(cin,further); check(further);
        output(999999,999999);
        getline(cin,closer); check(closer);
        work1(0,1000000);
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3548kb

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
0 1
0 0
1 0
500000 500000
500001 500000
500001 500001
250000 250000
250001 250000
250001 250001
125000 125000
125001 125000
125001 125001
62500 62500
62501 62500
62501 62501
31250 31250
31251 31250
31251 31251
15625 15625
15626 15625
15626 15626
7813 7813
7814 7813
7814 7814
3907 3907
3908 3907
...

result:

ok 64 points

Test #2:

score: 0
Accepted
time: 1ms
memory: 3688kb

input:

rr
qq
ww
qq
qq
qq
qq
qq
qq
qq
ww
ww
ww
qq
ww
ww
qq
ww
ww
ww
qq
qq
qq
qq
qq
qq
qq
qq
ww
ww
ww
qq
ww
ww
qq
ww
ww
ww
qq
qq
qq
qq
qq
qq
qq
qq
ww
ww
ww
qq
ww
ww
qq
ww
ww
qq
qq
You are lucky today!

output:

0 0
0 1
0 0
1 0
500000 500000
500001 500000
500001 500001
750000 750000
750001 750000
750001 750001
875000 875000
875001 875000
875001 875001
812500 812500
812501 812500
812501 812501
781250 781250
781251 781250
781251 781251
765625 765625
765626 765625
765626 765626
773438 773438
773439 773438
7734...

result:

ok 58 points

Test #3:

score: 0
Accepted
time: 1ms
memory: 3540kb

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
0 1
0 0
1 0
500000 500000
500001 500000
500001 500001
250000 250000
250001 250000
250001 250001
125000 125000
125001 125000
125001 125001
62500 62500
62501 62500
62501 62501
31250 31250
31251 31250
31251 31251
15625 15625
15626 15625
15626 15626
7813 7813
7814 7813
7814 7814
3907 3907
3908 3907
...

result:

ok 63 points

Test #4:

score: 0
Accepted
time: 1ms
memory: 3540kb

input:

voyne net
miru mir
mir miru
miru mir
miru mir
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
mir miru
miru mir
mir miru
miru mir
miru mir
mi...

output:

0 0
0 1
0 0
1 0
500000 500000
500001 500000
500001 500001
750000 250000
750001 250000
750001 250001
625000 125000
625001 125000
625001 125001
562500 187500
562501 187500
562501 187501
593750 218750
593751 218750
593751 218751
578125 234375
578126 234375
578126 234376
570313 242188
570314 242188
5703...

result:

ok 60 points

Test #5:

score: 0
Accepted
time: 1ms
memory: 3540kb

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
0 1
0 0
1 0
500000 500000
500001 500000
500001 500001
250000 750000
250001 750000
250001 750001
125000 625000
125001 625000
125001 625001
187500 562500
187501 562500
187501 562501
218750 593750
218751 593750
218751 593751
234375 578125
234376 578125
234376 578126
242188 570313
242189 570313
2421...

result:

ok 64 points

Test #6:

score: 0
Accepted
time: 1ms
memory: 3552kb

input:

mmimRRmmmmuiiuuiuimRmiiuiuiiuu
mmimRRmmmmuiiuuiuimRmiiuiuiiuR
mmimRRmmmmuiiuuiuimRmiiuiuiiui
mmimRRmmmmuiiuuiuimRmiiuiuiiuR
mmimRRmmmmuiiuuiuimRmiiuiuiiuR
mmimRRmmmmuiiuuiuimRmiiuiuiiui
mmimRRmmmmuiiuuiuimRmiiuiuiiui
mmimRRmmmmuiiuuiuimRmiiuiuiiuR
mmimRRmmmmuiiuuiuimRmiiuiuiiuR
mmimRRmmmmuiiuuiuimRm...

output:

0 0
0 1
0 0
1 0
500000 500000
500001 500000
500001 500001
250000 250000
250001 250000
250001 250001
375000 375000
375001 375000
375001 375001
312500 312500
312501 312500
312501 312501
343750 343750
343751 343750
343751 343751
328125 328125
328126 328125
328126 328126
335938 335938
335939 335938
3359...

result:

ok 61 points

Test #7:

score: 0
Accepted
time: 1ms
memory: 3696kb

input:

uiuumRmiRuRuRmmimuuummiRuiRumR
uiuumRmiRuRuRmmimuuummiRuiRumi
uiuumRmiRuRuRmmimuuummiRuiRumu
uiuumRmiRuRuRmmimuuummiRuiRumi
uiuumRmiRuRuRmmimuuummiRuiRumi
uiuumRmiRuRuRmmimuuummiRuiRumi
uiuumRmiRuRuRmmimuuummiRuiRumi
uiuumRmiRuRuRmmimuuummiRuiRumi
uiuumRmiRuRuRmmimuuummiRuiRumu
uiuumRmiRuRuRmmimuuum...

output:

0 0
0 1
0 0
1 0
500000 500000
500001 500000
500001 500001
750000 750000
750001 750000
750001 750001
625000 625000
625001 625000
625001 625001
687500 687500
687501 687500
687501 687501
656250 656250
656251 656250
656251 656251
671875 671875
671876 671875
671876 671876
664063 664063
664064 664063
6640...

result:

ok 55 points

Test #8:

score: 0
Accepted
time: 1ms
memory: 3692kb

input:

RiRiiiimiRiiiuRuuRiRmuRiuRuRR!

output:

0 0

result:

ok 1 points

Test #9:

score: 0
Accepted
time: 1ms
memory: 3692kb

input:

imRRmiRiRiRuimuiRiiiumiiRRmRim
RuRummmRRimumRimuRRiRuRuuiuRui
mRmmmRmRRmiiuiummmuiiiuiRiRRmu
RuRummmRRimumRimuRRiRuRuuiuRui
RuRummmRRimumRimuRRiRuRuuiuRui
RuRummmRRimumRimuRRiRuRuuiuRui
RuRummmRRimumRimuRRiRuRuuiuRui
RuRummmRRimumRimuRRiRuRuuiuRui
RuRummmRRimumRimuRRiRuRuuiuRui
RuRummmRRimumRimuRRiR...

output:

0 0
0 1
0 0
1 0
500000 500000
500001 500000
500001 500001
750000 750000
750001 750000
750001 750001
875000 875000
875001 875000
875001 875001
937500 937500
937501 937500
937501 937501
968750 968750
968751 968750
968751 968751
984375 984375
984376 984375
984376 984376
992188 992188
992189 992188
9921...

result:

ok 61 points

Test #10:

score: -100
Wrong Answer
time: 0ms
memory: 3800kb

input:

RiuimmRRRmmiimmiRuRRRmRiuimRum
RiuimmRRRmmiimmiRuRRRmRiuimRuR
RiuimmRRRmmiimmiRuRRRmRiuimRuu
RiuimmRRRmmiimmiRuRRRmRiuimRuu
RiuimmRRRmmiimmiRuRRRmRiuimRuR
RiuimmRRRmmiimmiRuRRRmRiuimRuR

output:

0 0
0 1
0 0
1 0
1000000 1000000
999999 999999
#0 1000000
250000 250000

result:

wrong answer format  Expected integer, but "#0" found