Submission #1031262

#TimeUsernameProblemLanguageResultExecution timeMemory
1031262happy_nodePacking Biscuits (IOI20_biscuits)C++17
9 / 100
1044 ms5080 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; long long count_tastiness(long long X, std::vector<long long> a) { while(a.size()<60) a.push_back(0); vector<ll> good; // set of good y's good.push_back(0); ll sum=0; for(int b=0;b<60;b++) { sum+=a[b]*(1LL<<b); int s=good.size(); if(s>200'000) break; for(int i=0;i<s;i++) { ll y=good[i]+(1LL<<b); if(y<=sum/X) { assert(y>good.back()); good.push_back(y); } else { break; } if(s==200'000) break; } } return good.size(); }
#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...