Submission #308354

#TimeUsernameProblemLanguageResultExecution timeMemory
3083544fectaPacking Biscuits (IOI20_biscuits)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; #define ll long long #define int ll #define ld long double #define pii pair<int, int> #define f first #define s second #define readl(_s) getline(cin, (_s)); #define boost() cin.tie(0); cin.sync_with_stdio(0) const int MN = 65; int k, dp[MN], psa[MN]; int count_tastiness(int x, vector<int> a) { k = a.size(); memset(dp, 0, sizeof(dp)); memset(psa, 0, sizeof(psa)); psa[0] = a[0]; for (int i = 1; i < k; i++) { psa[i] = a[i] * (1 << i) + psa[i - 1]; //printf("%d\n", psa[i]); } set<int> ans; ans.insert(0); if (psa[0] >= x) ans.insert(1); for (int i = 0; i < 30; i++) { vector<int> tmp; for (int val : ans) { int y = val + (1 << i); //printf("%d\n", y); if (psa[i] >= x * y) tmp.push_back(y); } for (int p : tmp) ans.insert(p); } /*for (int i = 1; i <= 1000000; i++) { int b = 0; for (int s = 0; s < 30; s++) if (i & (1 << s)) b = s; if (psa[b] >= x * i && ans.count(i - (1 << b))) ans.insert(i); }*/ return ans.size(); } int32_t main() { boost(); printf("%lld\n", count_tastiness(2, {2, 1, 2})); return 0; }

Compilation message (stderr)

/tmp/ccrJbau8.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc6e9yA7.o:biscuits.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status