(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #795754

#TimeUsernameProblemLanguageResultExecution timeMemory
795754alexander707070Packing Biscuits (IOI20_biscuits)C++14
0 / 100
1082 ms340 KiB
#include<bits/stdc++.h> using namespace std; const long long mod=1e9+7; long long x,sum,curr,mult; int k,ans; vector<long long> br; bool dali; long long count_tastiness(long long X,vector<long long> A){ k=int(A.size()); x=X; br.resize(k); ans=0; for(int i=0;i<=100000/x;i++){ for(int f=0;f<k;f++)br[f]=A[f]; dali=true; for(int f=0;f<x;f++){ curr=i; for(int t=k-1;t>=0;t--){ mult=min(curr/(1LL<<t),br[t]); curr-=mult*(1LL<<t); br[t]-=mult; } if(curr!=0)dali=false; } if(dali)ans++; } return ans; } /* int main(){ cout<<count_tastiness(2, {2, 1, 2})<<"\n"; cout<<count_tastiness(2, {2, 1, 2})<<"\n"; } */
#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...