Submission #724872

#TimeUsernameProblemLanguageResultExecution timeMemory
724872MohamedAliSaidanePacking Biscuits (IOI20_biscuits)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int,int> pii; typedef vector<pii> vpi; #define ff first #define ss second #define pb push_back #define all(x) (x).begin(),(x).end() const ll MOD = 1e9 + 7, INF = 1e18; ll mod(ll x, ll m = MOD) {return (x + m) % m;} int n; ll x, tot = 0ll; vll A; bool check(ll s) { vll B = A; for(int i =0; i < x; i++) { ll cur = s; for(int j = n - 1; j >= 0; j--) { ll q = min(B[j], cur/(1 << j)); cur -= q * (1 << j); B[j] -= q; } if(cur > 0) return false; } return true; } ll sub1() { int ans = 0; for(int i =0; i <= tot/x; i++) { if(i == 0 || check(i)) ans++; } return ans; } map<ll,ll> dp[100]; ll f(int i, ll sum) { if(i == n - 1) return 1ll; if(dp[i].find(sum) != dp[i].end()) return dp[i][sum]; if(sum > 0) return dp[i][sum] = f(i + 1, sum/2ll + A[i + 1]) + f(i + 1, (sum - 1)/2ll + A[i + 1]); else return dp[i][sum] = f(i + 1, A[i + 1]); } ll count_tastiness(ll X, vll a) { x = X; A = a; n = (int)(a.size()); while(n < 100) { A.pb(0ll); n++; } return f(0, a[0]); } int32_t main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout << count_tastiness(1, {2, 1, 2}); }

Compilation message (stderr)

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