제출 #283680

#제출 시각아이디문제언어결과실행 시간메모리
283680erd1커다란 상품 (IOI17_prize)C++14
컴파일 에러
0 ms0 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; #define pb push_back #define ff first #define ss second #define all(x) (x).begin(), (x).end() int find_best(int n) { int l = 0, r = n; while(true){ vector<int> res = ask(l+r>>1); if(res[0] + res[1] == 0) return i; if(res[0])r = (l+r>>1); else l = (l+r>>1)+1; } }

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:13:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   13 |   vector<int> res = ask(l+r>>1);
      |                         ~^~
prize.cpp:15:11: error: 'i' was not declared in this scope
   15 |    return i;
      |           ^
prize.cpp:16:19: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   16 |   if(res[0])r = (l+r>>1);
      |                  ~^~
prize.cpp:17:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   17 |   else l = (l+r>>1)+1;
      |             ~^~