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 "biscuits.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
#define debug(x) {cerr<<#x<<"="<<x<<"\n";}
#define debug2(x, y) {cerr<<"{"<<#x<<", "<<#y<<"}={"<<x<<", "<<y<<"}\n";}
#define debugp(p) {cerr<<#p<<"={"<<p.first<<", "<<p.second<<"}\n";}
#define debugv(abcd) {cerr<<#abcd<<": "; for (auto dcba:abcd) cerr<<dcba<<", ";cerr<<"\n";}
#define pb push_back
#define all(x) x.begin(), x.end()
#define SZ(x) ((int)x.size())
const int inf=1000000100; // 1e9
const ll INF=10000000001000000; // 1e16
const int mod=1000000007;
const int N=61;
ll n, m, k, x, y, u, v, t, a, b;
ll A[N];
ll count_tastiness(ll x, vector<ll> _A){
_A.resize(N, 0);
for (int i=0; i<N; i++) A[i]=_A[i];
for (int i=1; i<N; i++) A[i]=(A[i]<<i)+A[i-1];
for (int i=0; i<N; i++) A[i]=(A[i])/x;
ll ans=0;
for (ll y=0; y<=A[N-1]; y++){
int ok=1;
for (int i=0; i<N && ok; i++) if ((y&((1ll<<(i+1))-1))>A[i]) ok=0;
ans+=ok;
// if (ok) debug(y)
}
// debug(ans)
// cerr<<"\n";
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... |