Submission #1051934

# Submission time Handle Problem Language Result Execution time Memory
1051934 2024-08-10T10:41:13 Z MrAndria Colors (BOI20_colors) C++14
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>
using namespace std;
#define ff first;
#define ss second
#define pb push_back
//#define int long long
int k,l,r,n,ans;
bool b1;
int main(){
    cin>>n;
    cout<<"? "<<1<<endl;
    cin>>b1;
    
    l=2;
    r=n;
    k=2;
    while(true){
        if(k%2==0){
            cout<<"? "<<r<<endl;
            cin>>b1;
            if(b1==1){
                ans=r-(l-1);
            }else{
                break;
            }
            r--;
        }else{
            cout<<"? "<<l<<endl;
            cin>>b1;
            if(b1==1){
                ans=(r+1)-l;
            }else{
                break;
            }
            l++;
        }
        k++;
        
    }
    cout<<"= "<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (5 queries)
2 Correct 0 ms 344 KB OK (6 queries)
3 Correct 0 ms 344 KB OK (10 queries)
4 Incorrect 1 ms 344 KB Hair color 14 was used multiple times
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (5 queries)
2 Correct 0 ms 344 KB OK (6 queries)
3 Correct 0 ms 344 KB OK (10 queries)
4 Incorrect 1 ms 344 KB Hair color 14 was used multiple times
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (5 queries)
2 Correct 0 ms 344 KB OK (6 queries)
3 Correct 0 ms 344 KB OK (10 queries)
4 Incorrect 1 ms 344 KB Hair color 14 was used multiple times
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (5 queries)
2 Correct 0 ms 344 KB OK (6 queries)
3 Correct 0 ms 344 KB OK (10 queries)
4 Incorrect 1 ms 344 KB Hair color 14 was used multiple times
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB OK (5 queries)
2 Correct 0 ms 344 KB OK (6 queries)
3 Correct 0 ms 344 KB OK (10 queries)
4 Incorrect 1 ms 344 KB Hair color 14 was used multiple times
5 Halted 0 ms 0 KB -