(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 #1069459

#TimeUsernameProblemLanguageResultExecution timeMemory
1069459LeaRousePacking Biscuits (IOI20_biscuits)C++14
0 / 100
1073 ms428 KiB
#include "biscuits.h" #include <iostream> using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { int s = 0,k = a.size(); for(int i = 0; i < k; i++) s += a[i] * (1<<i); int ans = 1; for(int i = 1; i <= s/x; i++){ vector<long long> b = a; bool go = true; for(int j = 0; j < 20; j++){ if(i&(1<<j)){ for(int _ = 0; _ < x; _++){ int c = j, cant = 1; if(c >= k){ go= false; break; } while(b[c] < cant){ b[c] = 0; cant -= b[c]; cant *= 2; c--; } if(c==-1) { go = false; break; } b[c] -= cant; } } } if(go) { 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...