This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "biscuits.h"
using namespace std;
long long x,cnt,arr1[200001],arr2[200001];
vector<long long> a;
long long count_tastiness(long long X , vector<long long> A){
a = A , x = X;
while(a.size() < 60){
a.push_back(0ll);
}
memset(arr1,-1,sizeof arr1);
arr1[0] = 0;
for(int i = 0 ; i < 60 ; i += 1){
memset(arr2,-1,sizeof arr2);
cnt = 0;
for(int j = 0 ; j <= 200000 ; j += 1){
if(arr1[j] == -1){
break;
}
long long p = arr1[j]+a[i];
arr2[cnt++] = p/2;
if(p >= x){
arr2[cnt++] = (p-x)/2;
}
}
swap(arr1,arr2);
}
long long ret = 0;
for(int i = 0 ; i <= 200000 ; i += 1){
if(arr1[i] == -1){
break;
}
ret += 1;
}
return ret;
}
# | 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... |