Submission #1169402

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11694022025-03-18 16:04:50mnbvcxz123Bootfall (IZhO17_bootfall)C++20
100 / 100
743 ms1064 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int N = 500 * 250 + 5;
constexpr int M = 500 * 500 + 5;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
cout.tie(nullptr);
int n;
cin >> n;
vector<int> a(n);
for (auto &u : a)
cin >> u;
int tot = accumulate(a.begin(), a.end(), 0);
auto get = [&] (int ban) {
bitset<N> ret;
ret[0] = 1;
for (int i = 0; i < n; i++) {
if (i == ban) continue;
ret |= ret << a[i];
}
return ret;
};
auto ini = get(-1);
if (tot&1 or !ini[tot>>1])
return cout << "0", 0;
bitset<M> df;
df.set();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...