This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |