제출 #389900

#제출 시각아이디문제언어결과실행 시간메모리
389900Osama_Alkhodairy비스킷 담기 (IOI20_biscuits)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
//~ #include "biscuits.h"
#include "grader.cpp"
using namespace std;
#define ll long long

int k;
ll x;
vector <ll> a, s;
map <ll, ll> dp;

ll solve(ll p){
    if(p == 1) return 1;
    if(p <= 0) return 0;
    if(dp.count(p)) return dp[p];
    int b = __lg(p);
    if((p & (p - 1)) == 0) b--;
    return dp[p] = solve(1LL << b) + solve(min(p, 1 + s[b] / x) - (1LL << b));
}
long long count_tastiness(long long X, vector<long long> A){
    x = X;
    a = A;
    k = a.size();
    while(k < 60){
        a.push_back(0);
        k++;
    }
    s.clear();
    s.resize(k);
    for(int i = 0 ; i < k ; i++){
        if(i > 0) s[i] = s[i - 1];
        s[i] += (1LL << i) * a[i];
    }
    dp.clear();
    return solve(1LL << 60);
}

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

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