# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1167148 | SmuggingSpun | Bootfall (IZhO17_bootfall) | C++20 | 1 ms | 584 KiB |
#include<bits/stdc++.h>
#define taskname "A"
using namespace std;
const int lim = 505;
int n, a_max, a_sum = 0, a[lim];
namespace sub12{
const int LIM = 605;
void solve(){
bitset<LIM>dp;
dp.reset();
dp.set(0);
for(int i = 1; i <= n; i++){
dp |= dp << a[i];
}
if((a_sum & 1) || !dp.test(a_sum >> 1)){
return void(cout << 0);
}
vector<int>ans;
for(int i = a_sum - a_max; i > 0; i--){
ans.emplace_back(i);
for(int j = 1; j <= n; j++){
int sum = a_sum + i - a[j];
if(sum & 1){
ans.pop_back();
break;
}
dp.reset();
dp.reset(0);
dp.set(i);
sum >>= 1;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |