제출 #883142

#제출 시각아이디문제언어결과실행 시간메모리
883142serifefedartarBali Sculptures (APIO15_sculpture)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(0);cin.tie(0); #define s second #define f first typedef long long ll; const ll MOD = 1e9 + 9; const ll LOGN = 21; const ll MAXN = 3000; vector<ll> arr; ll pref[MAXN], N, A, B; pair<ll,ll> dp[MAXN]; bool check(ll mid) { dp[0] = {0, 0}; for (int i = 1; i < MAXN; i++) dp[i] = {1e12, -1e12}; for (int i = 1; i <= N; i++) { for (int j = i-1; j >= 0; j--) { if ((mid | (pref[i] - pref[j])) == mid) dp[i] = {min(dp[i].f, dp[j].f + 1), max(dp[i].s, dp[j].s + 1)}; } } return (B >= dp[N].f && A <= dp[N].s); } void solve1() { ll ans = (1LL << 35) - 1; for (int bit = 34; bit >= 0; bit--) { bool ch = check(ans ^ (1LL << bit)); if (ch) ans ^= (1LL << bit); } cout << ans << "\n"; } int main() { cin >> N >> A >> B; arr = vector<ll>(N+1); for (int i = 1; i <= N; i++) { cin >> arr[i]; pref[i] = pref[i-1] + arr[i]; } if (N > 100) solve1(); else solve2(); }

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

sculpture.cpp: In function 'int main()':
sculpture.cpp:52:3: error: 'solve2' was not declared in this scope; did you mean 'solve1'?
   52 |   solve2();
      |   ^~~~~~
      |   solve1