Submission #620930

#TimeUsernameProblemLanguageResultExecution timeMemory
620930KLPPPacking Biscuits (IOI20_biscuits)C++14
9 / 100
1134 ms788500 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) #define trav(a,v) for(auto a:v) typedef long long int lld; lld arr[100]; int k; vector<lld> V; vector<lld> NXT; lld ans; void calc(int pos, lld x){ if(pos==60)return; NXT.clear(); trav(a,V){ if(a+arr[pos]>=x){ NXT.push_back((a+arr[pos]-x)/2); ans++; } NXT.push_back((a+arr[pos])/2); } V.clear(); trav(a,NXT){ V.push_back(a); } NXT.clear(); calc(pos+1,x); } long long count_tastiness(long long x, std::vector<long long> a) { rep(i,0,100)arr[i]=0; V.clear(); NXT.clear(); k=a.size(); rep(i,0,k)arr[i]=a[i]; V.push_back(0); ans=0; calc(0,x); return ans+1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...