제출 #347829

#제출 시각아이디문제언어결과실행 시간메모리
347829beksultan04커다란 상품 (IOI17_prize)C++14
20 / 100
76 ms1468 KiB
#include "prize.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; #define lol 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) { int mx=0,i; map <int,vector <int>> mp; for (i=0;i<n;++i){ vector <int> a; if (!mp.count(i)) mp[i] = ask(i); a = mp[i]; if (!(a[0]+a[1]))ret i; mx = max(a[0]+a[1],mx); if (mx != a[0]+a[1])continue; int l = i,r = n-1; while (r >= l){ int m = l+r>>1; vector <int> b; if (!mp.count(m)){ mp[m] = ask(m); } b = mp[m]; if (!(b[0]+b[1]))ret m; if (!b[1]){ n = m-1; } if (!b[0] || a == b){ l = m+1; i = m; } else { r = m-1; } } { int l = i,r = n-1; while (r >= l){ int m = l+r>>1; vector <int> b; if (!mp.count(m)){ mp[m] = ask(m); } b = mp[m]; if (!(b[0]+b[1]))ret m; if (!b[0]){ i = m; } if (!b[1] || a == b){ r = m-1; n = m; } else { l = m+1; } } } } }

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:44:22: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   44 |             int m = l+r>>1;
      |                     ~^~
prize.cpp:68:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   68 |                 int m = l+r>>1;
      |                         ~^~
prize.cpp:28:28: warning: control reaches end of non-void function [-Wreturn-type]
   28 |     map <int,vector <int>> mp;
      |                            ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...