이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll count_tastiness(ll x, std::vector<ll> a) {
ll n=a.size();
ll ans=1;
for(ll v=1;v<=100000;v++)
{
auto b=a;
bool pos=1;
for(int j=0;j<x;j++)
{
ll sm=v;
for(int k=n-1;k>=0 and sm>0;k--)
{
ll pw=(1ll<<k),cur=min(b[k],(sm/pw));
sm-=(cur*pw);
b[k]-=cur;
}
if(sm>0)
{
pos=0;
break;
}
}
ans+=pos;
}
return ans;
}
# | 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... |