이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include <bits/stdc++.h>
#define fr first
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define sc second
#define all(s) s.begin(), s.end()
#define int long long
using namespace std;
int ans = 1;
int count_tastiness(int x, vector<int> a) {
ans = 1;
int sum = 0;
int nrbiti = (int)a.size();
for(int i=0;i<nrbiti;i++){
sum += a[i] * (1LL << i);
}
for(int curr=1;curr<=sum/x;curr++){
vector<int>need(x + 1, 0);
vector<int>b = a;
b.push_back(0);
for(int i=0;(1LL<<i)<=curr;i++){
if(curr & (1LL<<i) && b[i] < x){
goto next;
}
else{
if(curr & (1LL << i)) b[i] -= x;
b[i + 1] += (b[i] / 2);
}
}
++ans;
next:;
}
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... |