제출 #1133591

#제출 시각아이디문제언어결과실행 시간메모리
1133591alterio비스킷 담기 (IOI20_biscuits)C++20
0 / 100
1096 ms320 KiB
#include <bits/stdc++.h> #include "biscuits.h" #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("Ofast,unroll-loops") using namespace std; #define ll long long ll count_tastiness(ll x, vector<ll> a) { ll ans = 0, sum = 0; int n = a.size(); for (ll i = 0; i < n; i++) sum += (1LL << i) * a[i]; for (ll y = 0; y <= sum / x; y++) { vector<ll> c = a; bool pos = 1; for (int j = 0; j < x; j++) { ll cur = 0; for (int l = c.size() - 1; l >= 0; l--) { while (c[l] > 0 && cur + (1LL << l) <= y) { c[l]--; cur += (1LL << l); } } if (cur != y) { pos = 0; break; } } ans += pos; } return ans; }
#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...