이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
long long count_tastiness(long long x, std::vector<long long> a) {
int n=60;
while((int)a.size()<n){
a.push_back(0);
}
if(x<=10000){
vector<long long>dp(x*3+10),fake(x*3+10);
long long unnow=0;
for(int i=0;i<n;i++){
a[i]+=unnow;
if(a[i]>x){
unnow=a[i]-x;
unnow/=2;
a[i]-=unnow*2;
}else{
unnow=0;
}
//cout<<i<<" "<<a[i]<<endl;
}
dp[0]=1;
for(int i=0;i<n;i++){
for(int j=0;j<=x*3;j++){
fake[j/2+a[i]]+=dp[j];
if(j/2>=(x-a[i])){
fake[j/2-(x-a[i])]+=dp[j];
}
}
for(int j=0;j<=x*3;j++){
swap(dp[j],fake[j]);
fake[j]=0;
}
}
long long mainres=0;
for(int i=0;i<=x*3;i++){
mainres+=dp[i];
}
return mainres;
}else{
return 0;
}
}
# | 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... |