제출 #96373

#제출 시각아이디문제언어결과실행 시간메모리
96373figter001커다란 상품 (IOI17_prize)C++14
컴파일 에러
0 ms0 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e5+50; int ans,n; void solve(int l,int r){ if(l > r || ans != -1)return; int md = (l+r)/2; vector<int> res = ask(a); if(res[0] > res[1]){ solve(l,md-1); solve(md+1,r); }else{ solve(md+1,r); solve(l,md-1); } } int find_best(int N) { memset(dp,0,sizeof(dp)); n = N; ans = -1; solve(0,n-1); return ans; }

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

prize.cpp: In function 'void solve(int, int)':
prize.cpp:14:24: error: 'a' was not declared in this scope
  vector<int> res = ask(a);
                        ^
prize.cpp: In function 'int find_best(int)':
prize.cpp:25:9: error: 'dp' was not declared in this scope
  memset(dp,0,sizeof(dp));
         ^~