Submission #1018189

#TimeUsernameProblemLanguageResultExecution timeMemory
1018189BoasPacking Biscuits (IOI20_biscuits)C++17
0 / 100
450 ms412 KiB
#include <bits/stdc++.h> using namespace std; #include "biscuits.h" #define int long long #define loop(x, i) for (int i = 0; i < x; i++) #define pb push_back #define ALL(x) (x).begin(), (x).end() typedef vector<int> vi; typedef pair<int, int> ii; typedef set<int> si; typedef vector<vi> vvi; int count_tastiness(int x, vi a) { int res = 0; int max = 100'000; for (int v = 0; v <= max; v++) { int left = v; for (int i = ((int)a.size()) - 1; i >= 0; i--) { int pow = 1; loop(i, j) pow *= 2; if (pow > v) continue; int take = left / pow; take = min(take, a[i]); left -= take * pow; } if (left == 0 && v % x == 0) res++; } return res; }
#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...