답안 #930502

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
930502 2024-02-20T04:03:38 Z UmairAhmadMirza Colors (BOI20_colors) C++14
0 / 100
0 ms 344 KB
// Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin>>n;
    if(n==1){
        cout<<"= "<<1<<endl;
        return 0;
    }
    int low=0,high=n;
    while(high-low>1){
        int mid=(high+low)/2;
        bool rec=0;
        cout<<"? "<<1<<endl;
        cin>>rec;
        cout<<"? "<<1+mid<<endl;
        cin>>rec;
        if(rec)
            high=mid;
        else
            low=mid;
    }
    cout<<"= "<<high<<endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Hair color 1 was used multiple times
2 Halted 0 ms 0 KB -