Submission #1240010

#TimeUsernameProblemLanguageResultExecution timeMemory
1240010franuch비스킷 담기 (IOI20_biscuits)C++20
44 / 100
1138 ms1310216 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; typedef long long ll; typedef __int128 xl; typedef pair<ll, ll> pll; #define vc vector #define st first #define nd second #define all(a) a.begin(), a.end() #define sz(a) (ll)a.size() #define pub push_back #define pob pop_back ll count_tastiness(ll x, vc<ll> a) { xl n = sz(a); vc<xl> b = {0}; b.reserve(200'000); xl sa = 0; for (xl i = 0; ; i++) { if (i < n) sa += xl(a[i]) * (xl(1) << i); xl k = sz(b); bool flag = false; for (xl j = 0; j < k; j++) { xl nw = b[j] + xl(x) * (xl(1) << i); if (nw <= sa) { b.pub(nw); flag = true; } else break; } if (i >= n and not flag) break; } return sz(b); }
#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...