Submission #914367

#TimeUsernameProblemLanguageResultExecution timeMemory
914367AmrColors (BOI20_colors)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef long double ld;#define S second#define F first#define all(x) (x).begin(),(x).end()#define sz size()#define Yes cout << "YES" << endl#define No cout << "NO" << endl#define pb(x) push_back(x);#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);const int N=3e5+7;ll INF=INT_MAX,mod=1e9+7;int TT=1;ll power(ll x, unsigned int y){ ll res = 1; x = x; // % mod; if (x == 0) return 0; while (y > 0) { if (y & 1) res = (res*x) ; // % mod; y = y>>1; x = (x*x) ; // % mod; } return res;}void solve(){ ll n; cin >> n; ll lst = 1,over =n-1; cout << "? " << 1 << endl; ll cn; cin >> cn; while(1) { if(lst+over<=n) lst+=over; else lst-=over; cout << "? " << lst << endl; cin >> cn; if(cn==0) {cout << over+1 << endl; break;} over--; }}int main(){ //freopen("friday.in","r",stdin); //freopen("friday.out","w",stdout); fast; // cin >> TT; while(TT--) solve(); return 0;}

Compilation message (stderr)

Colors.cpp:1:31: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>using namespace std;typedef long long ll;typedef long double ld;#define S second#define F first#define all(x) (x).begin(),(x).end()#define sz size()#define Yes cout << "YES" << endl#define No cout << "NO" << endl#define pb(x) push_back(x);#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);const int N=3e5+7;ll INF=INT_MAX,mod=1e9+7;int TT=1;ll power(ll x, unsigned int y){    ll res = 1;    x = x; // % mod;    if (x == 0) return 0;    while (y > 0)    {        if (y & 1) res = (res*x)  ; // % mod;        y = y>>1;        x = (x*x) ; // % mod;    }    return res;}void solve(){    ll n; cin >> n;    ll lst = 1,over =n-1;    cout << "? " << 1 << endl; ll cn; cin >> cn;    while(1)    {        if(lst+over<=n) lst+=over; else lst-=over;        cout << "? " << lst << endl; cin >> cn;        if(cn==0) {cout << over+1 << endl; break;}        over--;    }}int main(){    //freopen("friday.in","r",stdin);    //freopen("friday.out","w",stdout);    fast;   // cin >> TT;    while(TT--)        solve();    return 0;}
      |                               ^~~~~~~~~
Colors.cpp:1:10: fatal error: bits/stdc++.h>usin: No such file or directory
    1 | #include <bits/stdc++.h>using namespace std;typedef long long ll;typedef long double ld;#define S second#define F first#define all(x) (x).begin(),(x).end()#define sz size()#define Yes cout << "YES" << endl#define No cout << "NO" << endl#define pb(x) push_back(x);#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);const int N=3e5+7;ll INF=INT_MAX,mod=1e9+7;int TT=1;ll power(ll x, unsigned int y){    ll res = 1;    x = x; // % mod;    if (x == 0) return 0;    while (y > 0)    {        if (y & 1) res = (res*x)  ; // % mod;        y = y>>1;        x = (x*x) ; // % mod;    }    return res;}void solve(){    ll n; cin >> n;    ll lst = 1,over =n-1;    cout << "? " << 1 << endl; ll cn; cin >> cn;    while(1)    {        if(lst+over<=n) lst+=over; else lst-=over;        cout << "? " << lst << endl; cin >> cn;        if(cn==0) {cout << over+1 << endl; break;}        over--;    }}int main(){    //freopen("friday.in","r",stdin);    //freopen("friday.out","w",stdout);    fast;   // cin >> TT;    while(TT--)        solve();    return 0;}
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.