Submission #420247

#TimeUsernameProblemLanguageResultExecution timeMemory
420247vkgainzPacking Biscuits (IOI20_biscuits)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int64_t count_tastiness(int64_t x, vector<int64_t> a) { int64_t ans = 1; int64_t curr = 0, lst = -1; for(int i = 0; i < (int) a.size(); i++) { if(curr < (1LL << (i - lst))) ans *= (curr + 1), curr = 0, lst = i; curr += (1LL << (i - lst)) * a[i]; } ans *= (curr + 1); return ans; } int main() { int N; cin >> N; vector<int64_t> a(N); for(int i = 0; i < N; i++) { cin >> a[i]; } cout << count_tastiness(1, a); }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc7ZVnYM.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cctN6dsN.o:biscuits.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc7ZVnYM.o: in function `main':
grader.cpp:(.text.startup+0x48b): undefined reference to `count_tastiness(long long, std::vector<long long, std::allocator<long long> >)'
collect2: error: ld returned 1 exit status