제출 #308356

#제출 시각아이디문제언어결과실행 시간메모리
308356crackersamdjam비스킷 담기 (IOI20_biscuits)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define gc getchar() #define pc(x) putchar(x) template<typename T> void scan(T &x){x = 0;bool _=0;T c=gc;_=c==45;c=_?gc:c;while(c<48||c>57)c=gc;for(;c<48||c>57;c=gc);for(;c>47&&c<58;c=gc)x=(x<<3)+(x<<1)+(c&15);x=_?-x:x;} template<typename T> void printn(T n){bool _=0;_=n<0;n=_?-n:n;char snum[65];int i=0;do{snum[i++]=char(n%10+48);n/= 10;}while(n);--i;if (_)pc(45);while(i>=0)pc(snum[i--]);} template<typename First, typename ... Ints> void scan(First &arg, Ints&... rest){scan(arg);scan(rest...);} template<typename T> void print(T n){printn(n);pc(10);} template<typename First, typename ... Ints> void print(First arg, Ints... rest){printn(arg);pc(32);print(rest...);} #ifndef ONLINE_JUDGE template<typename T> void pr(T a){std::cerr<<a<<std::endl;} template<typename T,typename... Args> void pr(T a, Args... args) {std::cerr<<a<<' ',pr(args...);} #else template<typename... Args> void pr(Args... args){} #endif using namespace std; using ll = long long; #include <ext/pb_ds/assoc_container.hpp> __gnu_pbds::gp_hash_table<ll, ll> dp[69]; ll x; vector<ll> a; ll go(int i, ll v){ if(i < 0) return !v; if(dp[i].find(v) != dp[i].end()) return dp[i][v]; ll add = a[i]*(1LL<<i); return dp[i][v] = go(i-1, max(0LL, v-add)) + go(i-1, max(0LL, v-add+x*(1LL<<i))); } ll count_tastiness(ll _x, vector<ll> _a){ a = _a, x = _x; a.emplace_back(0); a.emplace_back(0); // for(int t = 0; t < 30; t++) // a.emplace_back(0); int n = size(a); return go(n-1, 0); } int main(){ print(count_tastiness(3, {5, 2, 1})); }

컴파일 시 표준 에러 (stderr) 메시지

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