제출 #825190

#제출 시각아이디문제언어결과실행 시간메모리
825190fatemetmhr비스킷 담기 (IOI20_biscuits)C++17
0 / 100
19 ms440 KiB
// ~ Be Name Khoda ~ // #include "biscuits.h" #include <bits/stdc++.h> //#pragma GCC optimize ("O3") //#pragma GCC target("avx2") //#pragma GCC optimize("unroll-loops,Ofast") using namespace std; typedef long long ll; #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define fi first #define se second const int maxn = 1e6 + 10; const int maxn5 = 5e5 + 10; const int maxnt = 1.2e6 + 10; const int maxn3 = 1e3 + 10; const int mod = 1e9 + 7; const ll inf = 1e18; ll x, sum[100]; vector <ll> solve(int i, vector <ll> need){ vector <ll> av; if(i == -1){ av.resize(int(need.size()) + 1); fill(all(av), 1); return av; } need.pb(sum[i]); //cout << i << ' ' << need.size() << ' ' << sum[i] << endl; for(auto y : need){ if(y >= (1ll << i) * x) av.pb(y - (1ll << i) * x); else av.pb(y); } av = solve(i - 1, av); for(int j = 0; j < int(av.size()) - 1; j++){ if(need[j] >= (1ll << i) * x) av[j] += av.back(); //cout << i << ' ' << j << ' ' << need[j] << ' ' << av[j] << endl; } av.pop_back(); return av; } long long count_tastiness(long long xx, std::vector<long long> a) { x = xx; for(int i = 0; i < int(a.size()); i++){ sum[i] = a[i] * (1ll << i); if(i) sum[i] += sum[i - 1]; } for(int i = a.size(); i < 60; i++) sum[i] = sum[i - 1]; vector <ll> av; av = solve(59, av); //cout << "hey " << av.size() << endl; return av.back(); }
#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...