Submission #947311

# Submission time Handle Problem Language Result Execution time Memory
947311 2024-03-15T21:31:37 Z SuPythony Mađioničar (COI22_madionicar) C++17
0 / 100
1104 ms 412 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n; cin>>n;
    int ans=-1;
    for (int i=n; i>1; i--) {
        for (int j=1; j+i-1<=n; j++) {
            cout<<"? "<<j<<" "<<j+i-1<<endl;
            cout.flush();
            int res; cin>>res;
            if (res==1) {
                ans=i;
                break;
            }
        }
        if (ans!=-1) break;
    }
    if (ans==-1) ans=1;
    cout<<"! "<<ans<<endl;
    cout.flush();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1104 ms 408 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1104 ms 408 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1020 ms 412 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1104 ms 408 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -