Submission #304429

#TimeUsernameProblemLanguageResultExecution timeMemory
304429Masalmah비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1046 ms480 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; const int N= 100001; long long count_tastiness(long long x, vector<long long> a) { long long ans= 1; for (int y= 1; y<= N; y++) { vector<long long> proc; for (int i= 0; i< (int)a.size(); i++) proc.push_back(a[i]); while (proc.size()< 60) proc.push_back(0); bool nt= 1; for (int B= 59; B>= 0; B--) { long long cnt= 0; if (y&((long long)1<< B)) { cnt= x; if (proc[B]>= cnt) { proc[B]-= cnt; cnt= 0; } else { for (int BB= B; BB>= 0; BB--) { int ct= min(cnt, proc[BB]); cnt-= ct; proc[BB]-= ct; if (cnt== 0) { break; } else cnt*= 2; } } } if (cnt) { nt= 0; break; } } if (nt) ans++; } return ans; }
#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...