제출 #103083

#제출 시각아이디문제언어결과실행 시간메모리
103083username커다란 상품 (IOI17_prize)C++14
0 / 100
3091 ms312 KiB
#include<bits/stdc++.h> #include "prize.h" using namespace std; typedef pair<int,int> pii; typedef vector<int> VI; #define REP(i,j,k) for(register int i=(j);i<(k);++i) #define RREP(i,j,k) for(register int i=(j)-1;i>=(k);--i) #define ALL(a) a.begin(),a.end() #define MST(a,v) memset(a,(v),sizeof a) #define pb push_back #define mid (l+r>>1) #define lch (idx*2+1) #define rch (idx*2+2) #define F first #define S second #define de(...) cerr<<__VA_ARGS__ #define ar(a,s,t) {REP(__i,s,t)de(a[__i]<<' ');de(endl);} map<int,pii>mp; pii qr(int i){ if(mp.count(i))return mp[i]; else{ VI tt=ask(i); return mp[i]=pii(tt[0],tt[1]); } } void dfs(int l,int r,int&res){ if(res>=0)return; else if(l!=r&&qr(l)==qr(r))return; else{ if(qr(mid).F+qr(mid).S==0)res=mid; if(l!=mid&&qr(l)!=qr(mid))dfs(l,mid-1,res); if(mid!=r&&qr(mid)!=qr(r))dfs(mid,r,res); } } int find_best(int n){ int res=-1; dfs(0,n-1,res); return res; }

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

prize.cpp: In function 'void dfs(int, int, int&)':
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:32:9: note: in expansion of macro 'mid'
   if(qr(mid).F+qr(mid).S==0)res=mid;
         ^~~
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:32:19: note: in expansion of macro 'mid'
   if(qr(mid).F+qr(mid).S==0)res=mid;
                   ^~~
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:32:33: note: in expansion of macro 'mid'
   if(qr(mid).F+qr(mid).S==0)res=mid;
                                 ^~~
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:33:9: note: in expansion of macro 'mid'
   if(l!=mid&&qr(l)!=qr(mid))dfs(l,mid-1,res);
         ^~~
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:33:24: note: in expansion of macro 'mid'
   if(l!=mid&&qr(l)!=qr(mid))dfs(l,mid-1,res);
                        ^~~
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:33:35: note: in expansion of macro 'mid'
   if(l!=mid&&qr(l)!=qr(mid))dfs(l,mid-1,res);
                                   ^~~
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:34:6: note: in expansion of macro 'mid'
   if(mid!=r&&qr(mid)!=qr(r))dfs(mid,r,res);
      ^~~
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:34:17: note: in expansion of macro 'mid'
   if(mid!=r&&qr(mid)!=qr(r))dfs(mid,r,res);
                 ^~~
prize.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
 #define mid (l+r>>1)
              ~^~
prize.cpp:34:33: note: in expansion of macro 'mid'
   if(mid!=r&&qr(mid)!=qr(r))dfs(mid,r,res);
                                 ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...