| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 780867 | Elias | 비스킷 담기 (IOI20_biscuits) | C++17 | 1084 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#ifndef _DEBUG
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#endif
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define int long long
#ifndef _DEBUG
#include "biscuits.h"
#endif
#ifdef _DEBUG
long long count_tastiness(long long x, std::vector<long long> a);
#endif
int X;
vector<int> A;
int dp(int i, int carry)
{
if (carry < 0)
return 0;
if (i >= 60)
return 1;
int available_here = (i >= A.size() ? 0 : A[i]) + carry / 2;
return dp(i + 1, available_here) + dp(i + 1, available_here - X);
}
long long count_tastiness(long long x, std::vector<long long> a)
{
X = x;
A = a;
return dp(0, 0);
}
#ifdef _DEBUG
signed main()
{
int q;
assert(scanf("%lld", &q) == 1);
vector<int> k(q);
vector<long long> x(q);
vector<vector<long long>> a(q);
vector<long long> results(q);
for (int t = 0; t < q; t++)
{
assert(scanf("%lld%lld", &k[t], &x[t]) == 2);
a[t] = vector<long long>(k[t]);
for (int i = 0; i < k[t]; i++)
{
assert(scanf("%lld", &a[t][i]) == 1);
}
}
fclose(stdin);
for (int t = 0; t < q; t++)
{
results[t] = count_tastiness(x[t], a[t]);
}
for (int t = 0; t < q; t++)
{
printf("%lld\n", results[t]);
}
fclose(stdout);
return 0;
}
#endif
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
