Submission #1015836

#TimeUsernameProblemLanguageResultExecution timeMemory
1015836UnforgettableplPacking Biscuits (IOI20_biscuits)C++17
9 / 100
1062 ms10072 KiB
#include <bits/stdc++.h> using namespace std; const int LIMIT = 59; long long DP[LIMIT+2][20004]; long long count_tastiness(long long x, std::vector<long long> a) { DP[0][0]=1; a.resize(LIMIT+2); for(int i=0;i<=LIMIT;i++){ if(a[i]<x+2)continue; int can = a[i]-x; can/=2; a[i+1]+=can; a[i]-=2ll*can; } for(long long i=0;i<=LIMIT;i++){ for(long long j=0;j<=20003;j++){ DP[i+1][j] = DP[i][max(0ll,min(20003ll,2ll*(j-a[i])))] + DP[i][max(0ll,min(20003ll,2ll*(j-a[i]+x)))]; } } return DP[LIMIT+1][0]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...