Submission #860523

#TimeUsernameProblemLanguageResultExecution timeMemory
860523mychecksedadPacking Biscuits (IOI20_biscuits)C++17
42 / 100
1052 ms24000 KiB
// #include<biscuits.h> #include<bits/stdc++.h> using namespace std; #define ll long long int #define MOD (1000000000+7) #define MOD1 (998244353) #define pb push_back #define all(x) x.begin(), x.end() #define en cout << '\n' const int N = 1e6+100, M = 1e5+10, K = 22; ll count_tastiness(ll x, vector<ll> a){ for(int i = 0; i < 100; ++i) a.pb(0); int n = a.size(); ll ans = 1; map<ll, ll> p; p[0] = 1; for(int i = 0; i < n; ++i){ map<ll, ll> pp; for(auto z: p){ ll y = z.first; pp[(y+a[i])>>1] += z.second; if((y+a[i]-x) >= 0){ pp[(y+a[i]-x)>>1] += z.second; ans += z.second; } } p.swap(pp); // for(auto f: p) cout << f << ' '; // en; // cout << ans << '\n'; } 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...