제출 #390540

#제출 시각아이디문제언어결과실행 시간메모리
390540aarr커다란 상품 (IOI17_prize)C++14
컴파일 에러
0 ms0 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; int n; const int N = 200 * 1000 + 5; pair <int, int> res[N]; bool mark[N]; int solve(int s, int e) { if (e - s <= 2) { return n; } int md = (s + e) / 2; ask_save(md); if (res[md].first + res[md].second == 0) { return md; } int ans = n; if (res[md] != res[s]) { ans = solve(s, md + 1); if (ans < n) { return ans; } } if (res[md] != res[e]) { ans = min(ans, solve(md, e)); } return ans; } int find_best(int n) { ask_save(0); ask_save(n - 1); if (res[0].first + res[0].second == 0) { return 0; } if (res[n - 1].first + res[n - 1].second == 0) { return n - 1; } return solve(0, n); }

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

prize.cpp: In function 'int solve(int, int)':
prize.cpp:16:2: error: 'ask_save' was not declared in this scope
   16 |  ask_save(md);
      |  ^~~~~~~~
prize.cpp: In function 'int find_best(int)':
prize.cpp:34:2: error: 'ask_save' was not declared in this scope
   34 |  ask_save(0);
      |  ^~~~~~~~