제출 #468343

#제출 시각아이디문제언어결과실행 시간메모리
468343kessido비스킷 담기 (IOI20_biscuits)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define pi pair<int, int> #define ll long long int #define vll vector<ll> #define all(x) (x).begin(), (x).end() #define fori(i,n) for(int i = 0; i < int(n); i++) vll simplify(ll x, vll a) { ll extra = 0; for(ll &i : a) { extra += i; i = min(x, extra); extra -= i; if(extra&1) i++; extra /= 2; } while(a.size() < 61) a.push_back(0); return a; } unordered_map<ll, ll> dp[60]; ll recurse(int index, ll x, vll& a) { if(index >= 60) return 1; if(dp[index].count(a[index])) return dp[index][a[index]]; ll ans = 0; ll extra = (a[index]) / 2; a[index+1] += extra; ans += recurse(index+1, x, a); a[index+1] -= extra; if(a[index] >= x) { extra = (a[index] - x) / 2; a[index+1] += extra; ans += recurse(index+1, x, a); a[index+1] -= extra; } return dp[index][a[index]] = ans; } ll count_tastiness(ll x, vll a) { a = simplify(x, a); fori(i,60) dp[i].clear(); return recurse(0, x, a); } int main(int argc, char const *argv[]) { cout << count_tastiness(3, {5l,2l,1l}) << endl; return 0; }

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

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