제출 #816249

#제출 시각아이디문제언어결과실행 시간메모리
816249ono_de206커다란 상품 (IOI17_prize)C++14
컴파일 에러
0 ms0 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; #define in insert #define all(x) x.begin(),x.end() #define pb push_back #define eb emplace_back #define ff first #define ss second //#define int long long typedef long long ll; typedef vector<int> vi; typedef set<int> si; typedef multiset<int> msi; typedef pair<int, int> pii; typedef vector<pii> vpii; const int mxn = 2e5 + 10; pair<int, int> did[mxn]; int mx, ans; int get(int i) { if(did[i].ff != -1) return did[i].ff + did[i].ss; auto sus = ask(i); did[i].ff = sus[0]; did[i].ss = sus[1]; return did[i].ff + did[i].ss; } void solve(int l, int r) { if(l > r) return; int m = (l + r) / 2; if(get(m) == 0) ans = m; if(l == r) return; int m1 = m, m2 = m; while(m1 >= l) { if(get(m1) == mx) break; if(get(m1) == 0) ans = m1; m1--; } while(m2 <= r) { if(get(m2) == mx) break; if(get(m2) == 0) ans = m2; m2++; } if(m1 >= l && did[l].ff < did[m1].ff) solve(l, m1); if(r >= m2 && did[r].ff > did[m2].ff) solve(m2, r); } int find_best(int n) { if(n == 1) return 0; for(int i = 0; i < n; i++) { did[i] = {-1, -1}; } for(int i = 0; i < min(n, 469); i++) { if(get(i) == 0) return i; mxx(mx, get(i)); } solve(0, n - 1); return ans; }

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:61:3: error: 'mxx' was not declared in this scope; did you mean 'mx'?
   61 |   mxx(mx, get(i));
      |   ^~~
      |   mx