# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
585786 | LucaIlie | Packing Biscuits (IOI20_biscuits) | C++17 | 1 ms | 564 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include <bits/stdc++.h>
#define MAX_K 60
using namespace std;
long long count_tastiness( long long x, vector <long long> a ) {
int k;
long long s, m;
unordered_map <long, long long> dp[MAX_K];
k = 0;
s = 0;
for ( int b = 0; b < a.size() || s > 0; b++ ) {
a[b] += s;
if ( a[b] > x ) {
s = a[b] - x;
a[b] = x + s % 2;
s /= 2;
} else
s = 0;
k++;
}
dp[0][a[0]] = 1;
if ( a[0] - x >= 0 )
dp[0][a[0] - x] = 1;
for ( int b = 1; b < k; b++ ) {
for ( auto p: dp[b - 1] ) {
s = p.first;
m = p.second;
dp[b][s / 2 + a[b]] += m;
if ( s / 2 + a[b] - x >= 0 )
dp[b][s / 2 + a[b] - x] += m;
}
}
m = 0;
for ( auto p: dp[k - 1] )
m += p.second;
return m;
}
컴파일 시 표준 에러 (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... |