| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 305016 | arnold518 | 비스킷 담기 (IOI20_biscuits) | C++14 | 35 ms | 1024 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll X, A[100], P[100];
ll dp[100][100];
ll solve(int bit, int con)
{
if(bit==-1) return 1;
ll &ret=dp[bit][con];
if(ret!=-1) return ret;
ll t=P[con]&((1ll<<(bit+1))-1);
if(t>P[bit]) t=P[bit], con=bit;
ret=0;
if((1ll<<bit)>t)
{
ret+=solve(bit-1, con);
}
else
{
ret+=solve(bit-1, bit-1)+solve(bit-1, con);
}
//printf("%d %d : %lld\n", bit, con, ret);
return ret;
}
ll count_tastiness(ll _X, vector<ll> _A)
{
X=_X;
memset(A, 0, sizeof(A));
for(int i=0; i<_A.size(); i++) A[i]=_A[i];
for(int i=0; i<60; i++) P[i]=(1ll<<i)*A[i];
for(int i=1; i<60; i++) P[i]+=P[i-1];
for(int i=0; i<60; i++) P[i]/=X;
for(int i=0; i<60; i++) P[i]=min(P[i], (1ll<<(i+1))-1);
//for(int i=0; i<60; i++) printf("%d ", P[i]); printf("\n");
memset(dp, -1, sizeof(dp));
return solve(59, 59);
}컴파일 시 표준 에러 (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... | ||||
