제출 #394878

#제출 시각아이디문제언어결과실행 시간메모리
394878rocks03비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1088 ms332 KiB
//#pragma GCC target("avx2")
//#pragma GCC optimization("O3")
//#pragma GCC optimization("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define pb push_back
#define SZ(x) ((int)(x).size())
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define per(i, a, b) for(int i = (a); i >= (b); i--)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

long long count_tastiness(long long x, vector<long long> A){
    while(SZ(A) < 70) A.pb(0);
    ll s = 0;
    rep(i, 0, SZ(A)) s += (1ll << i) * A[i];
    ll ans = 1;
    rep(y, 1, s + 1){
        vector<ll> a = A;
        bool ok = true;
        rep(i, 0, 32){
            if(y >> i & 1){
                if(a[i] < x){
                    ok = false; break;
                }
                a[i] -= x;
            }
            a[i + 1] += a[i] / 2;
        }
        ans += (ok == true);
    }
    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...