제출 #602837

#제출 시각아이디문제언어결과실행 시간메모리
602837MohamedFaresNebiliPacking Biscuits (IOI20_biscuits)C++14
0 / 100
1094 ms796 KiB
#include <bits/stdc++.h> /// #pragma GCC optimize ("Ofast") /// #pragma GCC target ("avx2") /// #pragma GCC optimize("unroll-loops") using namespace std; using ll = long long; using ii = pair<ll, ll>; using vi = vector<int>; #define ff first #define ss second #define pb push_back #define all(x) (x).begin(), (x).end() #define lb lower_bound const int oo = 1000 * 1000 * 1000 + 7; ll count_tastiness(ll X, vector<ll> A) { ll K = A.size(); ll res = 0; ll C = 0, pw[60]; pw[0] = 1; for(ll l = 1; l < 60; l++) pw[l] = pw[l - 1] * 2ll; for(ll l = 0; l < K; l++) C += pw[l] * A[l]; for(ll l = 0; l * X <= C; l++) { ll T = 0; bool O = 1; for(ll i = 0; i < K && O; i++) { if(!(l & (1 << i))) { T += A[i]; T /= 2ll; continue; } T += A[i]; if(T < X) O = 0; T -= X; T /= 2; } res += O; } return res; }
#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...