Submission #930554

# Submission time Handle Problem Language Result Execution time Memory
930554 2024-02-20T06:30:48 Z Sir_Ahmed_Imran Joker (BOI20_joker) C++17
0 / 100
0 ms 348 KB
                              ///~~~LOTA~~~///
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define append push_back
#define add insert
#define nl "\n"
#define ff first
#define ss second
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL)
#define N 90001
void solve(){
    bool c;
    ll n,m,p,q;
    cin>>n;
    cout<<"? 1"<<endl;
    p=1;
    m=n-1;
    cin>>c;
    while(m){
        if((n-m)%2){
            cout<<"? "<<p+m<<endl;
            cin>>c;
            p+=m;
        }
        else{
            cout<<"? "<<p-m<<endl;
            cin>>c;
            p-=m;
        }
        if(!c) break;
        m--;
    }
    cout<<"= "<<m+1<<endl;
}
int main(){
    //L0TA;
    solve();
    return 0;
}

Compilation message

Joker.cpp: In function 'void solve()':
Joker.cpp:16:14: warning: unused variable 'q' [-Wunused-variable]
   16 |     ll n,m,p,q;
      |              ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -