Submission #996306

#TimeUsernameProblemLanguageResultExecution timeMemory
996306vqpahmadPacking Biscuits (IOI20_biscuits)C++14
9 / 100
1054 ms420 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; #ifdef ONPC #include"debug.h" #else #define debug(...) 42 #endif #define ll long long #define pii pair<int,int> #define F first #define S second #define pb push_back #define sz(a) (int)a.size() #define all(a) a.begin(),a.end() template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; } template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; } const int mod = 1e9 + 7; const int MAXN = 1e6 + 15; const int inf = 0x3f3f3f3f; const ll INF = 0x3f3f3f3f3f3f3f3f; long long count_tastiness(long long n, std::vector<long long> a) { a.resize(100); auto b = a; int ans = 0; for (ll k = 0; k <= 100000; k++){ a = b; bool good = 1; for (int i = 0; i < 62; i++){ ll more = a[i] - ((k >> i)&1) * n; good &= more >= 0; a[i + 1] += more / 2; } if (good) 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...