Submission #104050

#TimeUsernameProblemLanguageResultExecution timeMemory
104050RockyBThe Big Prize (IOI17_prize)C++17
Compilation error
0 ms0 KiB
#include "prize.h" #include <bits/stdc++.h> #define jizz ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); #define pb push_back #define MP make_pair #define F first #define S second #define ET cout << "\n" #define MEM(i,j) memset(i,j,sizeof i) #define ALL(v) v.begin(),v.end() #define DB(a,s,e) {for(int i=s;i<e;++i) cerr << a[i] << " ";ET;} using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; pii arr[200005]; pii query(int x) { if(~arr[x].F) return arr[x]; auto v=ask(x); return arr[x]=MP(v[0],v[1]); } int search(int l,int r) { if(r-l<=1) return -1; int m=l+r>>1; pii a=query(l),b=query(r),t=query(m); if(t==MP(0,0)) return m; if((t.F==a.F)||!t.F) return search(m,r); if((t.F==b.F)||!t.S) return search(l,m); if(rand()%2) { int df=search(l,m); if(~df) return df; return search(m,r); } int df=search(m,r); if(~df) return df; return search(l,m); } int find_best(int n) { srand(time('I' + 'O' + 'I')); fill(arr,arr+n,MP(-1,-1)); int ans = search(0,n-1); if (~ans) return ans; if(query(0)==MP(0,0)) return 0; if(query(n-1)==MP(0,0)) return n-1; }

Compilation message (stderr)

prize.cpp: In function 'int search(int, int)':
prize.cpp:28:9: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int m=l+r>>1;
        ~^~
prize.cpp: In function 'int find_best(int)':
prize.cpp:46:24: error: invalid conversion from 'int' to 'time_t* {aka long int*}' [-fpermissive]
   srand(time('I' + 'O' + 'I'));
              ~~~~~~~~~~^~~~~
In file included from /usr/include/c++/7/ctime:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:49,
                 from prize.cpp:2:
/usr/include/time.h:192:15: note:   initializing argument 1 of 'time_t time(time_t*)'
 extern time_t time (time_t *__timer) __THROW;
               ^~~~
prize.cpp:52:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^