제출 #282909

#제출 시각아이디문제언어결과실행 시간메모리
282909turbat커다란 상품 (IOI17_prize)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "prize.h" using namespace std; int find_best(int n) { int l, r, mx = -1e9, mid; for (int i = 0;i < min(10, n);i++){ int ind = rand() % n; vector<int> res = ask(ind); if(res[0] + res[1] == 0) return i; mx = max(mx , res[0]+res[1]); } for(int i = 0; i < n; i++){ vector<int> res = ask(i); if(res[0] + res[1] == 0) return i; mx = max(mx , res[0]+res[1]); if((res[0]+res[1]) < mx) continue; l = i + 1; r = n - 1; while(l <= r){ ll mid = (l+r)/2; vector<int> tmp=ask(mid); if(tmp[0]+tmp[1]==0)return mid; if(tmp == res){ i = mid; l = mid+1; } else r = mid-1; } } }

컴파일 시 표준 에러 (stderr) 메시지

prize.cpp: In function 'int find_best(int)':
prize.cpp:22:13: error: 'll' was not declared in this scope; did you mean 'l'?
   22 |             ll mid = (l+r)/2;
      |             ^~
      |             l
prize.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^