제출 #315715

#제출 시각아이디문제언어결과실행 시간메모리
315715Sorting비스킷 담기 (IOI20_biscuits)C++17
42 / 100
1089 ms15864 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll x, k; vector<ll> a; ll count_tastiness(ll _x, vector<ll> _a){ x = _x, a = _a; k = a.size(); map<ll, ll> curr, prev; prev[0] = 1; for(int i = 0; i < k; ++i, swap(prev, curr)){ curr.clear(); for(auto [key, value]: prev){ ll t = key + a[i]; curr[t / 2] += value; if(t >= x) curr[(t - x) / 2] += value; } } ll ans = 0; for(auto [key, value]: prev) ans += (key / x + 1) * value; 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...