Submission #479289

#TimeUsernameProblemLanguageResultExecution timeMemory
479289khoabrightPacking Biscuits (IOI20_biscuits)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; //#define int long long #define ff first #define ss second #define pii pair<int, int> #define all(x) x.begin(), x.end() #define rep(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define rep1(i, a, b) for (int i = (int)a; i >= (int)b; --i) #define mp make_pair #define vii vector<vector<int>> #define ll long long map<ll, ll> g; ll cal_g(ll n, ll x, vector<ll> &s) { //cout<<"n="<<n<<'\n'; if (n <= 0) return 0; if (n == 1) return 1; if (g.find(n) != g.end()) return g[n]; int i = log2(n - 1); return g[n] = cal_g(1ll << i, x, s) + cal_g(min(n, 1 + s[i] / x) - (1ll << i), x, s); } ll count_tastiness(ll x, vector<ll> a) { g.clear(); for(int i=1; i<(int)a.size(); i++) { a[i] = a[i-1] + (a[i]<<i); } while(a.size()<=60) a.push_back(a.back()); return cal_g(1+a.back(), x, a); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); //cout.tie(0); int t; cin >> t; while(t--){ long long x, k; vector<long long> v; cin >> k >> x; v.resize(k); rep(i, 0, k - 1) { cin >> v[i]; } cout << count_tastiness(x, v) << '\n'; } }

Compilation message (stderr)

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