Submission #255982

# Submission time Handle Problem Language Result Execution time Memory
255982 2020-08-02T07:27:43 Z 최은수(#5029) Colors (BOI20_colors) C++17
0 / 100
0 ms 384 KB
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+7;
const ll INF=1e18+7;
inline int query(ll x)
{
    cout<<"? "<<x;
    int r;
    cin>>r;
    return r;
}
inline void answer(ll x)
{
    cout<<"= "<<x;
    return;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin>>n;
    if(n<=64)
    {
        query(1);
        int cp=1;
        int cs=1;
        for(int i=n;i-->1;)
        {
            cp+=cs*i;
            int r=query(cp);
            if(r==0)
            {
                answer(i+1);
                return 0;
            }
        }
        answer(1);
        return 0;
    }
    ll s=1,e=n;
    ll pm=-INF;
    set<ll>st;
    return 0;
}

Compilation message

Colors.cpp: In function 'int main()':
Colors.cpp:52:8: warning: unused variable 's' [-Wunused-variable]
     ll s=1,e=n;
        ^
Colors.cpp:52:12: warning: unused variable 'e' [-Wunused-variable]
     ll s=1,e=n;
            ^
Colors.cpp:53:8: warning: unused variable 'pm' [-Wunused-variable]
     ll pm=-INF;
        ^~
# Verdict Execution time Memory Grader output
1 Execution timed out 0 ms 384 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 0 ms 384 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 0 ms 384 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 0 ms 384 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 0 ms 384 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -