제출 #1239984

#제출 시각아이디문제언어결과실행 시간메모리
1239984franuch비스킷 담기 (IOI20_biscuits)C++20
0 / 100
1 ms324 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 bool cont(xl mask, xl i) { return (mask & (xl(1) << i)) != xl(0); } ll count_tastiness(ll x, vc<ll> a) { xl n = sz(a); vc<xl> b = {0}; xl sa = 0; for (xl i = 0; i < 2 * n; i++) { if (i < n) sa += xl(a[i]) * (xl(1) << i); xl k = sz(b); for (xl j = 0; j < k; j++) { auto bj = b[j]; if (bj + xl(x) * (xl(1) << i) <= sa) b.pub(bj + xl(x) * (xl(1) << i)); else 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...