제출 #297899

#제출 시각아이디문제언어결과실행 시간메모리
297899Batyr커다란 상품 (IOI17_prize)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ss second #define ff first #define pii pair<int,int> #define mkp make_pair const int maxn=2e5+5; pii dp[maxn]; // vector<int> ask(int nd){ // return {1,2}; // } pii f(int l,int r){ if(dp[l] == mkp(0,0)){ vector<int>p = ask(l); dp[l].ff=p[0]; dp[l].ss=p[1]; } if(dp[r] == mkp(0,0)){ vector<int> p = ask(r); dp[r].ff=p[0]; dp[r].ss=p[1]; } if(dp[l].ff+dp[l].ss == dp[r].ff+dp[r].ss and dp[l].ss - dp[r].ss == 0) return {dp[l].ff + dp[l].ss,l}; pii cep=f(l,(l+r)/2); pii sag=f((l+r)/2,r); if(cep.ff < sag.ff) return cep; return sag; } int find_best(int n){ return f(0,n-1).ss; } // int main() { // cout<< find_best(4); // }

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

prize.cpp: In function 'std::pair<int, int> f(int, int)':
prize.cpp:18:24: error: 'ask' was not declared in this scope
   18 |         vector<int>p = ask(l);
      |                        ^~~
prize.cpp:23:25: error: 'ask' was not declared in this scope
   23 |         vector<int> p = ask(r);
      |                         ^~~