제출 #991482

#제출 시각아이디문제언어결과실행 시간메모리
991482fv3비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1059 ms600 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; typedef long long ll; ll count_tastiness(ll X, vector<ll> A) { if (X > 100000ll) return 1; // O(10⁵) ll res = 0; for (int y = 0; y < (100000 / X); y++) { vector<ll> a = A; bool p = true; for (int i = 0; i < X; i++) { int v = 0; for (int j = a.size() - 1; j >= 0; j--) { while (a[j] && v + (1 << j) <= y) { v += (1 << j); a[j]--; } } if (v != y) { p = false; break; } } p&&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...