Submission #1032264

#TimeUsernameProblemLanguageResultExecution timeMemory
1032264mdn2002Packing Biscuits (IOI20_biscuits)C++17
Compilation error
0 ms0 KiB
/* Mayoeba Yabureru */ #include<bits/stdc++.h> using namespace std; long long count_tastiness(long long x, vector<long long> a) { while (a.size() != 200) a.push_back(0); map<long long, long long> dp[202]; function<long long(int, long long)> f = [&] (int i, long long sum) { if (i > 60 && sum == 0) return 1ll; if (dp[i].count(sum)) return dp[i][sum]; long long ans = f(i + 1, (sum + a[i]) / 2); if (sum + a[i] >= x) ans += f(i + 1, (sum + a[i] - x) / 2); return dp[i][sum] = ans; }; return f(0, 0); } int main() { int q; assert(scanf("%d", &q) == 1); vector<int> k(q); vector<long long> x(q); vector<vector<long long>> a(q); vector<long long> results(q); for (int t = 0; t < q; t++) { assert(scanf("%d%lld", &k[t], &x[t]) == 2); a[t] = vector<long long>(k[t]); for (int i = 0; i < k[t]; i++) { assert(scanf("%lld", &a[t][i]) == 1); } } fclose(stdin); for (int t = 0; t < q; t++) { results[t] = count_tastiness(x[t], a[t]); } for (int t = 0; t < q; t++) { printf("%lld\n", results[t]); } fclose(stdout); return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc9NxmAB.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cclw8YkB.o:biscuits.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status