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"
using namespace std;
#define int long long
long long count_tastiness(long long x,vector<long long> a){
int k = a.size();
long long all =0;
for(int val = 0;val<=min((long long)1000000,(1ll<<k)-1);val++){
long long ans = 0;bool bad = 0;
for(int i = 0;i<k;i++){
ans/=2;
ans+=a[i];
if(val&(1ll<<i)){
if(ans<x){
bad = 1;break;
}
ans-=x;
}
}
if(!bad)all++;
}
return all;
}
# | 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... |