제출 #283681

#제출 시각아이디문제언어결과실행 시간메모리
283681erd1커다란 상품 (IOI17_prize)C++14
20 / 100
92 ms416 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 l+r>>1; 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:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   15 |    return l+r>>1;
      |           ~^~
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;
      |             ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...