제출 #303412

#제출 시각아이디문제언어결과실행 시간메모리
303412qiangbao비스킷 담기 (IOI20_biscuits)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> //#include "biscuits.h" using namespace std; typedef long long ll; ll ways[63]; ll pow2[63]; void ini() { ll i; pow2[0]=1; for(i=1;i<=62;i++) pow2[i]=pow2[i-1]*2; for(i=0;i<=62;i++) ways[i]=0; ways[0]=1; } ll count_tastiness(ll x, vector<ll> a) { ll tot=0; ll i, j; a.resize(64); ini(); for(i=0;i<62;i++){ ll way=0; tot+=a[i]*pow2[i]; ll tot2=tot; for(j=i;j>=0;j--) if(pow2[62]/x>=pow2[j] && tot2>=x*pow2[j]) tot2-=x*pow2[j], way+=ways[j]; ways[i+1]=way+1; } return ways[62]; } int main() { cout << count_tastiness(3, {3, 3}) << endl; cout << count_tastiness(3, {2, 3}) << endl; }

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

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