답안 #303836

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
303836 2020-09-20T16:50:50 Z Pajaraja 비스킷 담기 (IOI20_biscuits) C++17
0 / 100
3 ms 384 KB
#include "biscuits.h"
#include <bits/stdc++.h>
#define MAXN 67
using namespace std;
long long dp[MAXN],dpu[MAXN],p[MAXN];
long long count_tastiness(long long x, std::vector<long long> a)
{
    while(a.size()<60) a.push_back(0);
    int k=60;
    p[0]=a[0];
    for(long long i=1;i<k;i++) p[i]=p[i-1]+(a[i]<<i);
    for(long long i=0;i<k;i++)
    {
        long long mx=(p[i]-(x<<i))/x;
        dpu[i]=0;
        if(p[i]>=(x<<i))
        {
            dpu[i]=1;
            for(long long j=i;j>=0;j--) if((1LL<<j)&mx)
            {
                if(j!=0) dpu[i]+=dp[j-1];
                long long nx=(p[j]-(x<<j))/x;
                if(nx<mx) {dpu[i]+=dpu[j]; break;}
            }
        }
        dp[i]=(i!=0)?dp[i-1]:0;
        dp[i]+=dpu[i];
    }
	return dp[k-1]+1;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -