제출 #306117

#제출 시각아이디문제언어결과실행 시간메모리
306117MrDomino비스킷 담기 (IOI20_biscuits)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll x;
vector<ll> a;
vector<ll> limit;
int n;
int sol;

void bkt(int i, ll sum)
{
    if (i == 60)
    {
        sol++;
        return;
    }
    if (sum <= limit[i])
    {
        bkt(i + 1, sum);
    }
    if (sum + x * (1LL << i) <= limit[i])
    {
        bkt(i + 1, sum + x * (1LL << i));
    }
}

ll count_tastiness(ll xx, vector<ll> aa)
{
    sol = 0;
    x = xx;
    a = aa;
    n = (int) a.size();
    limit = a;
    ll c = 0;
    for (int i = 0; i < n; i++)
    {
        c += (1LL << i) * a[i];
        limit[i] = c;
    }
    while ((int) limit.size() < 60)
    {
        limit.push_back(limit.back());
    }
    bkt(0, 0);
    return sol;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    cout << count_tastiness(2, {2, 1, 2}) << "\n";
}

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

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