QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#511257#5206. Hot and ColdjakerRE 1ms3700kbC++202.4kb2024-08-09 18:06:132024-08-09 18:06:13

Judging History

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

  • [2024-08-09 18:06:13]
  • 评测
  • 测评结果:RE
  • 用时:1ms
  • 内存:3700kb
  • [2024-08-09 18:06:13]
  • 提交

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 , x2_n = x2;
    else 
        x1_n = x1 , x2_n = midx;
    if( tmp1 == closer )
        y1_n = midy , 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) {
    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(2*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: 3676kb

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 59 points

Test #2:

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

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
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
773437 773437
773438 773437
7734...

result:

ok 53 points

Test #3:

score: 0
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
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 59 points

Test #4:

score: 0
Accepted
time: 0ms
memory: 3556kb

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
570312 242187
570313 242187
5703...

result:

ok 62 points

Test #5:

score: 0
Accepted
time: 0ms
memory: 3676kb

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
242187 570312
242188 570312
2421...

result:

ok 62 points

Test #6:

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

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
335937 335937
335938 335937
3359...

result:

ok 61 points

Test #7:

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

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
664062 664062
664063 664062
6640...

result:

ok 58 points

Test #8:

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

input:

RiRiiiimiRiiiuRuuRiRmuRiuRuRR!

output:

0 0

result:

ok 1 points

Test #9:

score: 0
Accepted
time: 0ms
memory: 3700kb

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
992187 992187
992188 992187
9921...

result:

ok 64 points

Test #10:

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

input:

RiuimmRRRmmiimmiRuRRRmRiuimRum
RiuimmRRRmmiimmiRuRRRmRiuimRuR
RiuimmRRRmmiimmiRuRRRmRiuimRuu
RiuimmRRRmmiimmiRuRRRmRiuimRuu
RiuimmRRRmmiimmiRuRRRmRiuimRuR
RiuimmRRRmmiimmiRuRRRmRiuimRuR
RiuimmRRRmmiimmiRuRRRmRiuimRuR
RiuimmRRRmmiimmiRuRRRmRiuimRuR
RiuimmRRRmmiimmiRuRRRmRiuimRuR
RiuimmRRRmmiimmiRuRRR...

output:

0 0
0 1
0 0
1 0
1000000 1000000
999999 999999
250000 250000
250001 250001
375000 375000
375001 375001
437500 437500
437501 437501
468750 468750
468751 468751
484375 484375
484376 484376
492187 492187
492188 492188
496093 496093
496094 496094
498046 498046
498047 498047
499023 499023
499024 499024
49...

result:

ok 49 points

Test #11:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

muumRumummuRiiiRuRmmmimumuimmm
RuuimuiiuRmiRRummuiiuuiiiiRiuR
RuuRimimuimRRRmuuiRiiumuRRiiui
RuuRimimuimRRRmuuiRiiumuRRiiui
RuuimuiiuRmiRRummuiiuuiiiiRiuR
RuuRimimuimRRRmuuiRiiumuRRiiui
RuuRimimuimRRRmuuiRiiumuRRiiui
RuuRimimuimRRRmuuiRiiumuRRiiui
RuuRimimuimRRRmuuiRiiumuRRiiui
RuuRimimuimRRRmuuiRii...

output:

0 0
0 1
0 0
1 0
1000000 1000000
999999 999999
250000 250000
250001 250001
375000 375000
375001 375001
437500 437500
437501 437501
468750 468750
468751 468751
484375 484375
484376 484376
492187 492187
492188 492188
496093 496093
496094 496094
498046 498046
498047 498047
499023 499023
499024 499024
49...

result:

ok 50 points

Test #12:

score: -100
Runtime Error

input:

iiRmmuRiummRimiuiRRmmmimRummii
RmRumumumimiRmuimRRmuumiRRRiRR
mRuRuuRRiuiiiRiummuumRRRiRRmRu
RmRumumumimiRmuimRRmuumiRRRiRR
RmRumumumimiRmuimRRmuumiRRRiRR
mRuRuuRRiuiiiRiummuumRRRiRRmRu
mRuRuuRRiuiiiRiummuumRRRiRRmRu
RmRumumumimiRmuimRRmuumiRRRiRR
RmRumumumimiRmuimRRmuumiRRRiRR
RmRumumumimiRmuimRRmu...

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
335937 335937
335938 335937
3359...

result: