답안 #507200

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
507200 2022-01-12T09:39:31 Z abc864197532 Bootfall (IZhO17_bootfall) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define X first
#define Y second
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
void abc() {cout << endl;}
template <typename T, typename ...U> void abc(T i, U ...j) {
	cout << i << ' ', abc(j...);
}
template <typename T> void printv(T l, T r) {
	for (; l != r; ++l)
		cout << *l << " \n"[l + 1 == r];
}
#define test(x...) abc("[" + string(#x) + "]", x);
const int N = 500 * 500 + 5;

bitset <N> pre[501], suf[501];

int main () {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector <int> a(n);
	int sum = 0;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		sum += a[i];
		dp |= dp << a[i];
	}
	if (sum & 1 || !dp[sum >> 1]) {
		cout << 0 << endl << endl;
	} else {
		vector <int> ans(N, 0);
	}
}

Compilation message

bootfall.cpp: In function 'int main()':
bootfall.cpp:35:3: error: 'dp' was not declared in this scope; did you mean 'mp'?
   35 |   dp |= dp << a[i];
      |   ^~
      |   mp
bootfall.cpp:37:18: error: 'dp' was not declared in this scope; did you mean 'mp'?
   37 |  if (sum & 1 || !dp[sum >> 1]) {
      |                  ^~
      |                  mp