Submission #319177

#TimeUsernameProblemLanguageResultExecution timeMemory
319177nekiPacking Biscuits (IOI20_biscuits)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define loop(i, a, b) for(long long i=a;i<b;i++) #define pool(i, a, b) for(long long i=a-1;i>=b;i--) #define fore(i, a) for(auto&& i:a) #define fi first #define se second #define ps(a) push_back(a) #define pb(a) pop_back(a) #define sc scanf #define vc vector #define pa pair<ll, ll> #define ll int #define lb lower_bound #define ub upper_bound #define all(a) a.begin(), a.end() #define llmax LLONG_MAX/2 #define llmin -LLONG_MAX/2 using namespace std; #define mn 1010 #define pa pair<ll, ll> #define ld long double ll n, a[100]; ll solve(ll x, ll ind){ if(ind==n-1) return a[ind]/x + 1; a[ind+1]+=a[ind]/2; ll ret=solve(x, ind+1); a[ind+1]-=a[ind]/2; if(a[ind]>=x){ a[ind+1]+=(a[ind]-x)/2; ret+=solve(x, ind+1); a[ind+1]-=(a[ind]-x)/2; } return ret; } ll count_tastiness(ll x, vc<ll> ar){ n=ar.size(); loop(i, 0, n) a[i]=ar[i]; return solve(x, 0); } int main(){ cout << count_tastiness(2, vc<ll>{2, 1, 2}); }

Compilation message (stderr)

/tmp/ccyNxCIc.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc6ksw8s.o:biscuits.cpp:(.text.startup+0x0): first defined here
/tmp/ccyNxCIc.o: In function `main':
grader.cpp:(.text.startup+0x433): undefined reference to `count_tastiness(long long, std::vector<long long, std::allocator<long long> >)'
collect2: error: ld returned 1 exit status