제출 #789495

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

using namespace std;

const int maxn = 65;

int n;
long long x;

long long a[maxn];

map<pair<int, long long>, long long> dp;

long long f(int pos, long long carry)
{
    if (pos >= n)
    {
        return carry / x + 1;
    }

    if (dp.find(make_pair(pos, carry)) != dp.end())
    {
        return dp[make_pair(pos, carry)];
    }

    long long curr = carry + a[pos];

    long long ans = f(pos + 1, curr / 2);

    if (curr >= x)
    {
        ans += f(pos + 1, (curr - x) / 2);
    }

    return dp[make_pair(pos, carry)] = ans;
}

long long count_tastiness(long long X, vector<long long> arr)
{
    dp.clear();
    n = arr.size();
    x = X;

    for (int i = 0; i < n; ++i)
    {
        a[i] = arr[i];
    }

    return f(0, 0);
}

/*
1
3 3
5 2 1

1
3 2
2 1 2

2
3 3
5 2 1
3 2
2 1 2
*/

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

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