제출 #605427

#제출 시각아이디문제언어결과실행 시간메모리
605427Sam_a17Packing Biscuits (IOI20_biscuits)C++14
42 / 100
1100 ms16644 KiB
#include <bits/stdc++.h> using namespace std; #define sz(x) (int((x).size())) #define len(x) (int)x.length() #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define dbg(x) cout << #x << " " << x << endl; #define uniq(x) x.resize(unique(all(x)) - x.begin()); #define pb push_back #define ld long double #define ll long long // #include "mushrooms.h" int use_machine(vector<int> m); template<typename T> void pr(vector<T>& a) { cerr << "arr" << " "; for(auto i: a) { cerr << i << " "; } cerr << endl; } long long count_tastiness(long long x, std::vector<long long> a) { for(int i = 0; i < 66; i++) { a.push_back(0); } int k = sz(a); map<long long, long long> mp1, mp2; // mp1[0] = 1; // for(int i = 0; i < k; i++) { for(auto j: mp1) { mp2[(j.first + a[i]) / 2] += j.second; if(j.first + a[i] >= x) { mp2[(j.first + a[i] - x) / 2] += j.second; } } mp1 = mp2; mp2.clear(); } // long long answ = 0; for(auto i: mp1) { answ += i.second; } return answ; }
#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...