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