QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#523160#866. Display of SpringszjwwjhyAC ✓25ms3864kbC++143.9kb2024-08-17 21:35:392024-08-17 21:35:39

Judging History

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

  • [2024-08-17 21:35:39]
  • 评测
  • 测评结果:AC
  • 用时:25ms
  • 内存:3864kb
  • [2024-08-17 21:35:39]
  • 提交

answer

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define endl '\n'
using namespace std;
using ll=long long;
using db=double;
using pii=pair<int,int>;
const int inf=0x3f3f3f3f;
const int mod=998244353;
const int N=2e5+10,M=5e3+10;
int n;
int id[550];
double nl[550],k[550];
int na[550];
int nid[550],num[550],tot=-1;
string s;
void Sort(int l,int r){
    if(r==l) return ;
    int mid=id[rand()%(r-l+1)+l];
    // cout<<mid<<endl;
    int L=l-1,R=r+1;
    for(int i=l;i<=r;i++){
        if(id[i]==mid) continue;
        cout<<"? "<<id[i]<<" "<<mid<<" 1"<<endl;
        cin>>s;

        // if(nl[id[i]]<nl[mid]) s="FIRST";
        // else if(nl[id[i]]==nl[mid]) s="EQUAL";
        // else s="SECOND";

        if(s=="FIRST" || s=="EQUAL" && rand()%2) na[++L]=id[i];
        else na[--R]=id[i];
    }
    for(int i=l;i<=r;i++){
        id[i]=na[i];
    }
    id[L+1]=mid;
    // cout<<l<<" "<<L<<" "<<R<<" "<<r<<endl;
    // for(int i=l;i<=r;i++){
    //     cout<<id[i]<<" ";
    // }cout<<endl;
    if(L>=l) Sort(l,L);
    if(R<=r) Sort(R,r);
}
int bsearch(int i,int j,int L,int R){
    int l=L,r=R,mid;
    while(l<r){
        mid=(l+r)>>1;
        cout<<"? "<<i<<" "<<j<<" "<<mid<<endl;
        // cout<<"!! "<<nl[i]-mid/k[i]<<" "<<nl[j]-mid/k[j]<<endl;
        cin>>s;

        // if(nl[i]-mid/k[i]<nl[j]-mid/k[j]) s="FIRST";
        // else if(nl[i]-mid/k[i]==nl[j]-mid/k[j]) s="EQUAL";
        // else s="SECOND";
        
        if(s=="FIRST") l=mid+1;
        else r=mid;
    }
    return l;
}
int main()
{
    // ios::sync_with_stdio(false);
    // cin.tie(nullptr);
    srand(time(NULL));
    cin>>n;
    // nl[0]=100,nl[1]=50,nl[2]=52;
    // k[0]=3,k[1]=2,k[2]=1;
    for(int i=0;i<n;i++) id[i]=i;
    Sort(0,n-1);
    // for(int i=0;i<n;i++){
    //     cout<<id[i]<<" ";
    // }cout<<endl;
    int w=1;
    for(int i=0;i<n;i++){
        if(i==0) nid[++tot]=id[i],num[tot]=1;
        else{
            cout<<"? "<<nid[tot]<<" "<<id[i]<<" "<<100000<<endl;
            cin>>s;

            // cout<<"!! "<<nl[nid[tot]]-100000/k[nid[tot]]<<" "<<nl[id[i]]-100000/k[id[i]]<<endl;
            // if(nl[nid[tot]]-100000/k[nid[tot]]<nl[id[i]]-100000/k[id[i]]) s="FIRST";
            // else if(nl[nid[tot]]-100000/k[nid[tot]]==nl[id[i]]-100000/k[id[i]]) s="EQUAL";
            // else s="SECOND";

            if(s!="SECOND") continue;
            cout<<"? "<<nid[tot]<<" "<<id[i]<<" "<<w<<endl;
            cin>>s;

            // cout<<"!! "<<nl[nid[tot]]-w/k[nid[tot]]<<" "<<nl[id[i]]-w/k[id[i]]<<" "<<w<<endl;
            // if(nl[nid[tot]]-w/k[nid[tot]]<nl[id[i]]-w/k[id[i]]) s="FIRST";
            // else if(nl[nid[tot]]-w/k[nid[tot]]==nl[id[i]]-w/k[id[i]]) s="EQUAL";
            // else s="SECOND";

            while(s!="FIRST"){
                tot--;
                if(tot==-1) break;
                cout<<"? "<<nid[tot]<<" "<<id[i]<<" "<<w<<endl;
                cin>>s;
                w=num[tot];

                // cout<<"!! "<<nl[nid[tot]]-w/k[nid[tot]]<<" "<<nl[id[i]]-w/k[id[i]]<<" "<<w<<endl;
                // if(nl[nid[tot]]-w/k[nid[tot]]<nl[id[i]]-w/k[id[i]]) s="FIRST";
                // else if(nl[nid[tot]]-w/k[nid[tot]]==nl[id[i]]-w/k[id[i]]) s="EQUAL";
                // else s="SECOND";

            }
            nid[++tot]=id[i];
            if(tot==0){
                num[tot]=1;
            }
            else{
                num[tot]=bsearch(nid[tot-1],id[i],w,100000);
                // cout<<"______________"<<num[tot]<<endl;
            }
            w=num[tot];
        }
    }
    // for(int i=0;i<=tot;i++){
    //     cout<<i<<"->"<<nid[i]<<"="<<num[i]<<endl;
    // }
    cout<<"!"<<endl;
    while(cin>>s>>w){
        for(int i=0;i<=tot;i++){
            if(i==tot && w>=num[i] || w>=num[i] && w<num[i+1]){
                cout<<"! "<<nid[i]<<endl;
            }
        }
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3792kb

input:

3
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
EQUAL
FIRST
QUESTION 2
QUESTION 6
FINISH

output:

? 0 1 1
? 2 1 1
? 0 2 1
? 1 2 100000
? 1 2 1
? 1 2 50000
? 1 2 25000
? 1 2 12500
? 1 2 6250
? 1 2 3125
? 1 2 1563
? 1 2 782
? 1 2 391
? 1 2 196
? 1 2 98
? 1 2 49
? 1 2 25
? 1 2 13
? 1 2 7
? 1 2 4
? 1 2 6
? 1 2 5
? 2 0 100000
!
! 1
! 2

result:

ok Correct answer

Test #2:

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

input:

6
EQUAL
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
EQUAL
FIRST
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SE...

output:

? 0 1 1
? 2 1 1
? 3 1 1
? 4 1 1
? 5 1 1
? 5 4 1
? 3 4 1
? 2 4 1
? 0 4 1
? 2 3 1
? 0 3 1
? 0 2 1
? 1 0 100000
? 1 2 100000
? 1 2 1
? 1 2 50000
? 1 2 25000
? 1 2 12500
? 1 2 6250
? 1 2 3125
? 1 2 1563
? 1 2 782
? 1 2 391
? 1 2 196
? 1 2 98
? 1 2 49
? 1 2 25
? 1 2 13
? 1 2 7
? 1 2 4
? 1 2 2
? 1 2 1
? 2...

result:

ok Correct answer

Test #3:

score: 0
Accepted
time: 9ms
memory: 3792kb

input:

326
FIRST
SECOND
FIRST
SECOND
FIRST
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
SECOND
FIRST
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
SECOND
FIRST
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
F...

output:

? 0 151 1
? 1 151 1
? 2 151 1
? 3 151 1
? 4 151 1
? 5 151 1
? 6 151 1
? 7 151 1
? 8 151 1
? 9 151 1
? 10 151 1
? 11 151 1
? 12 151 1
? 13 151 1
? 14 151 1
? 15 151 1
? 16 151 1
? 17 151 1
? 18 151 1
? 19 151 1
? 20 151 1
? 21 151 1
? 22 151 1
? 23 151 1
? 24 151 1
? 25 151 1
? 26 151 1
? 27 151 1
? ...

result:

ok Correct answer

Test #4:

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

input:

19
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND...

output:

? 0 17 1
? 1 17 1
? 2 17 1
? 3 17 1
? 4 17 1
? 5 17 1
? 6 17 1
? 7 17 1
? 8 17 1
? 9 17 1
? 10 17 1
? 11 17 1
? 12 17 1
? 13 17 1
? 14 17 1
? 15 17 1
? 16 17 1
? 18 17 1
? 9 8 1
? 12 8 1
? 13 8 1
? 12 9 1
? 18 6 1
? 16 6 1
? 15 6 1
? 14 6 1
? 11 6 1
? 10 6 1
? 7 6 1
? 5 6 1
? 4 6 1
? 3 6 1
? 2 6 1
?...

result:

ok Correct answer

Test #5:

score: 0
Accepted
time: 6ms
memory: 3792kb

input:

500
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECO...

output:

? 0 199 1
? 1 199 1
? 2 199 1
? 3 199 1
? 4 199 1
? 5 199 1
? 6 199 1
? 7 199 1
? 8 199 1
? 9 199 1
? 10 199 1
? 11 199 1
? 12 199 1
? 13 199 1
? 14 199 1
? 15 199 1
? 16 199 1
? 17 199 1
? 18 199 1
? 19 199 1
? 20 199 1
? 21 199 1
? 22 199 1
? 23 199 1
? 24 199 1
? 25 199 1
? 26 199 1
? 27 199 1
? ...

result:

ok Correct answer

Test #6:

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

input:

500
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQUAL
EQ...

output:

? 0 199 1
? 1 199 1
? 2 199 1
? 3 199 1
? 4 199 1
? 5 199 1
? 6 199 1
? 7 199 1
? 8 199 1
? 9 199 1
? 10 199 1
? 11 199 1
? 12 199 1
? 13 199 1
? 14 199 1
? 15 199 1
? 16 199 1
? 17 199 1
? 18 199 1
? 19 199 1
? 20 199 1
? 21 199 1
? 22 199 1
? 23 199 1
? 24 199 1
? 25 199 1
? 26 199 1
? 27 199 1
? ...

result:

ok Correct answer

Test #7:

score: 0
Accepted
time: 7ms
memory: 3832kb

input:

500
SECOND
FIRST
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
FIRST
SECO...

output:

? 0 199 1
? 1 199 1
? 2 199 1
? 3 199 1
? 4 199 1
? 5 199 1
? 6 199 1
? 7 199 1
? 8 199 1
? 9 199 1
? 10 199 1
? 11 199 1
? 12 199 1
? 13 199 1
? 14 199 1
? 15 199 1
? 16 199 1
? 17 199 1
? 18 199 1
? 19 199 1
? 20 199 1
? 21 199 1
? 22 199 1
? 23 199 1
? 24 199 1
? 25 199 1
? 26 199 1
? 27 199 1
? ...

result:

ok Correct answer

Test #8:

score: 0
Accepted
time: 16ms
memory: 3728kb

input:

500
FIRST
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
FIRST
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECO...

output:

? 0 184 1
? 1 184 1
? 2 184 1
? 3 184 1
? 4 184 1
? 5 184 1
? 6 184 1
? 7 184 1
? 8 184 1
? 9 184 1
? 10 184 1
? 11 184 1
? 12 184 1
? 13 184 1
? 14 184 1
? 15 184 1
? 16 184 1
? 17 184 1
? 18 184 1
? 19 184 1
? 20 184 1
? 21 184 1
? 22 184 1
? 23 184 1
? 24 184 1
? 25 184 1
? 26 184 1
? 27 184 1
? ...

result:

ok Correct answer

Test #9:

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

input:

2
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
QUESTION 64500
QUESTION 22602
QUESTION 37446
QUESTION 97972
QUESTION 78630
QUESTION 75591
QUESTION 63328
QUESTION 64746
QUESTION 94532
QUESTION 51275
QUESTION 1...

output:

? 1 0 1
? 0 1 100000
? 0 1 1
? 0 1 50000
? 0 1 25000
? 0 1 12500
? 0 1 6250
? 0 1 3125
? 0 1 1563
? 0 1 782
? 0 1 391
? 0 1 196
? 0 1 98
? 0 1 49
? 0 1 25
? 0 1 37
? 0 1 31
? 0 1 28
? 0 1 27
? 0 1 26
!
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! ...

result:

ok Correct answer

Test #10:

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

input:

2
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
FIRST
FIRST
SECOND
SECOND
FIRST
SECOND
FIRST
SECOND
SECOND
EQUAL
FIRST
QUESTION 54311
QUESTION 8466
QUESTION 82055
QUESTION 65419
QUESTION 5271
QUESTION 4799
QUESTION 21521
QUESTION 66767
QUESTION 24897
QUESTION 69127
QUESTION 84527
QUEST...

output:

? 1 0 1
? 0 1 100000
? 0 1 1
? 0 1 50000
? 0 1 25000
? 0 1 12500
? 0 1 6250
? 0 1 9375
? 0 1 10938
? 0 1 10157
? 0 1 10548
? 0 1 10743
? 0 1 10646
? 0 1 10597
? 0 1 10622
? 0 1 10610
? 0 1 10616
? 0 1 10613
? 0 1 10612
? 0 1 10611
!
! 1
! 0
! 1
! 1
! 0
! 0
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1
! 1...

result:

ok Correct answer

Test #11:

score: 0
Accepted
time: 25ms
memory: 3788kb

input:

500
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST...

output:

? 0 184 1
? 1 184 1
? 2 184 1
? 3 184 1
? 4 184 1
? 5 184 1
? 6 184 1
? 7 184 1
? 8 184 1
? 9 184 1
? 10 184 1
? 11 184 1
? 12 184 1
? 13 184 1
? 14 184 1
? 15 184 1
? 16 184 1
? 17 184 1
? 18 184 1
? 19 184 1
? 20 184 1
? 21 184 1
? 22 184 1
? 23 184 1
? 24 184 1
? 25 184 1
? 26 184 1
? 27 184 1
? ...

result:

ok Correct answer

Test #12:

score: 0
Accepted
time: 14ms
memory: 3736kb

input:

500
FIRST
SECOND
SECOND
SECOND
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
SECOND
SECOND
FIRST
FIRST
FIRST
SECOND
FIRST
FIRST
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
SECOND
FIRST
SECOND
SECOND
FIRST
SECOND
FIRST
FIR...

output:

? 0 184 1
? 1 184 1
? 2 184 1
? 3 184 1
? 4 184 1
? 5 184 1
? 6 184 1
? 7 184 1
? 8 184 1
? 9 184 1
? 10 184 1
? 11 184 1
? 12 184 1
? 13 184 1
? 14 184 1
? 15 184 1
? 16 184 1
? 17 184 1
? 18 184 1
? 19 184 1
? 20 184 1
? 21 184 1
? 22 184 1
? 23 184 1
? 24 184 1
? 25 184 1
? 26 184 1
? 27 184 1
? ...

result:

ok Correct answer

Test #13:

score: 0
Accepted
time: 5ms
memory: 3660kb

input:

500
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
SECOND
FIRST
FIRS...

output:

? 0 474 1
? 1 474 1
? 2 474 1
? 3 474 1
? 4 474 1
? 5 474 1
? 6 474 1
? 7 474 1
? 8 474 1
? 9 474 1
? 10 474 1
? 11 474 1
? 12 474 1
? 13 474 1
? 14 474 1
? 15 474 1
? 16 474 1
? 17 474 1
? 18 474 1
? 19 474 1
? 20 474 1
? 21 474 1
? 22 474 1
? 23 474 1
? 24 474 1
? 25 474 1
? 26 474 1
? 27 474 1
? ...

result:

ok Correct answer

Test #14:

score: 0
Accepted
time: 6ms
memory: 3816kb

input:

500
FIRST
SECOND
FIRST
SECOND
FIRST
FIRST
FIRST
SECOND
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
SECOND
FIRST
SECOND
FIRST
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
FIRST
SECOND
...

output:

? 0 474 1
? 1 474 1
? 2 474 1
? 3 474 1
? 4 474 1
? 5 474 1
? 6 474 1
? 7 474 1
? 8 474 1
? 9 474 1
? 10 474 1
? 11 474 1
? 12 474 1
? 13 474 1
? 14 474 1
? 15 474 1
? 16 474 1
? 17 474 1
? 18 474 1
? 19 474 1
? 20 474 1
? 21 474 1
? 22 474 1
? 23 474 1
? 24 474 1
? 25 474 1
? 26 474 1
? 27 474 1
? ...

result:

ok Correct answer

Test #15:

score: 0
Accepted
time: 10ms
memory: 3864kb

input:

500
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
SECOND
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
FIRST
F...

output:

? 0 46 1
? 1 46 1
? 2 46 1
? 3 46 1
? 4 46 1
? 5 46 1
? 6 46 1
? 7 46 1
? 8 46 1
? 9 46 1
? 10 46 1
? 11 46 1
? 12 46 1
? 13 46 1
? 14 46 1
? 15 46 1
? 16 46 1
? 17 46 1
? 18 46 1
? 19 46 1
? 20 46 1
? 21 46 1
? 22 46 1
? 23 46 1
? 24 46 1
? 25 46 1
? 26 46 1
? 27 46 1
? 28 46 1
? 29 46 1
? 30 46 1
...

result:

ok Correct answer

Test #16:

score: 0
Accepted
time: 12ms
memory: 3792kb

input:

500
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
FIRST
SECOND
FIRST
FIRST
SECOND
SECOND
SECOND
SECOND
FIRST
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
SECOND
FIRST...

output:

? 0 46 1
? 1 46 1
? 2 46 1
? 3 46 1
? 4 46 1
? 5 46 1
? 6 46 1
? 7 46 1
? 8 46 1
? 9 46 1
? 10 46 1
? 11 46 1
? 12 46 1
? 13 46 1
? 14 46 1
? 15 46 1
? 16 46 1
? 17 46 1
? 18 46 1
? 19 46 1
? 20 46 1
? 21 46 1
? 22 46 1
? 23 46 1
? 24 46 1
? 25 46 1
? 26 46 1
? 27 46 1
? 28 46 1
? 29 46 1
? 30 46 1
...

result:

ok Correct answer