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;
typedef long long ll;
ll count_tastiness(ll x,vector<ll> a){
int k=(int)a.size();
vector<ll>g=a;
int ret=0;
for(int y=0;y<=100000/x;y++){
a=g;
int cnt=0;
for(int j=0;j<x;j++){
int u=y;
for(int p=k-1;p>=0;p--){
if(a[p] && (1LL<<p)<=u){
u^=(1LL<<p);
--a[p];
}
}
if(!u)++cnt;
}
ret+=(cnt==x);
}
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... |