제출 #805888

#제출 시각아이디문제언어결과실행 시간메모리
805888LittleCube비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1079 ms3540 KiB
#include "biscuits.h" #include <bits/stdc++.h> #define ll long long using namespace std; int ans[400000]; long long count_tastiness(ll x, vector<ll> a) { a.resize(60); int k = 60; vector<ll> sum(k), fold(k); sum[0] = a[0]; for (int i = 1; i < k; i++) sum[i] = sum[i - 1] + (a[i] << i); for (int i = 0; i < k; i++) if (sum[i] / x / (1LL << i) == 0) fold[i] = -1; else fold[i] = min((1LL << i) - 1, (sum[i] - x * (1LL << i)) / x); int sz = 1; for (int i = 0; i < k; i++) { for (int j = 0; j < sz; j++) if(ans[j] <= fold[i]) ans[sz++] = (1LL << i) + ans[j]; } return sz; }
#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...