제출 #919657

#제출 시각아이디문제언어결과실행 시간메모리
919657dubabuba은행 (IZhO14_bank)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int mxn = 25; const int mxa = 1e6 + 10; vector<int> bit[mxa]; int sum[1 << mxn]; int n, a[mxn]; int m, b[mxn]; int dp[mxn][1 << mxn]; int solve(int i, int cur) { if(i == 0) return 1; if(dp[i][cur] > -1) return dp[i][cur]; int val = a[i]; dp[i][cur] = 0; for(int las : bit[val]) { bool sus = true; for(int j = 0; j < m; j++) if((cur & (1 << j)) == 0) sus = false; if(sus && solve(i - 1, cur ^ las)) dp[i][cur] = 1; } return dp[i][cur]; } int main() { cin >> n >> m; for(int i = 1; i <= n; i++) cin >> a[i]; for(int j = 0; j < m; j++) cin >> b[j]; for(int cur = 0; cur < (1 << m); cur++) { int sus, prv; for(sus = 0; sus < m; sus++) if(cur & (1 << sus)) break; prv = cur ^ (1 << sus); sum[cur] = sum[prv] + b[sus]; bit[sum[cur]].push_back(cur); } for(int i = 0; i < mxn; i++) for(int cur = 0; cur < (1 << mxn); cur++) dp[i][cur] = -1; if(solve(n, (1 << m) - 1)) cout << "YES\n"; else cout << "NO\n"; return 0; }

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

/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status