Submission #347515

#TimeUsernameProblemLanguageResultExecution timeMemory
347515beksultan04The Big Prize (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include "prize.h" #include "grader.cpp" #include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int,int> #define OK puts("OK"); #define NO puts("NO"); #define YES puts("YES"); #define fr first #define sc second #define ret return #define scanl(a) scanf("%lld",&a); #define scanll(a,b) scanf("%lld %lld",&a, &b); #define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define scan1(a) scanf("%d",&a); #define scan2(a,b) scanf("%d %d",&a, &b); #define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c); #define all(s) s.begin(),s.end() #define allr(s) s.rbegin()Ñ,s.rend() #define pb push_back #define sz(v) (int)v.size() #define endi puts(""); #define eps 1e-12 const int N = 3e5+12,INF=1e9+7; int find_best(int n) { priority_queue <pii> q; q.push({1,n}); while (!q.empty()){ int l = q.top().fr,r = q.top().sc; q.pop(); if (l == r){ vector <int> v = ask(r-1); if (v[0] == 0 && v[1] == 0){ ret l-1; } } else { int m = l+r>>1; vector <int> v = ask(m-1); if (v[0] == 0 && v[1] == 0){ ret m-1; } if (v[0] > 0){ if (m-1 >= l) q.push({l,m-1}); } if (v[1] > 0){ if (m+1 <= r){ q.push({m+1,r}); } } } } return 0; }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:39:22: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   39 |             int m = l+r>>1;
      |                     ~^~
/tmp/ccs8VsRo.o: In function `ask(int)':
grader.cpp:(.text+0x0): multiple definition of `ask(int)'
/tmp/ccWdS0Kf.o:prize.cpp:(.text+0x0): first defined here
/tmp/ccs8VsRo.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccWdS0Kf.o:prize.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status