이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long count_tastiness(long long x, std::vector<long long> a) {
ll k=a.size(), p[62];
p[0]=1;
for (int i=1; i<62; i++) p[i]=p[i-1]*2;
vector<ll> cnt(62), qs(62), res, tmp;
for (int i=0; i<k; i++) cnt[i]=a[i];
for (int i=0; i<62; i++) qs[i]=((i==0)?0:qs[i-1])+cnt[i]*p[i];
res.push_back(0);
for (int i=0; i<62; i++)
{
tmp.clear();
for (auto y:res)
{
if (qs[i]/x>=(y+p[i])) tmp.push_back(y+p[i]);
else break;
}
for (auto y:tmp) res.push_back(y);
}
return res.size();
}
| # | 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... |