Submission #434536

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4345362021-06-21 11:46:39arayiPacking Biscuits (IOI20_biscuits)C++17
33 / 100
106 ms21816 KiB
#include "biscuits.h"
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define ad push_back
#define lli long long
lli dp[123][20110];
long long count_tastiness(long long x, std::vector<long long> a)
{
for (int i = 0; i <= 60; i++) a.ad(0);
for (int i = 0; i < (int)a.size(); i++)
for (int j = 0; j <= 2*x+100; j++) dp[i][j]=0;
for (int i = 0; i < (int)a.size() - 1; i++)
{
a[i+1] += max(0LL, (a[i]-x)/2LL);
a[i] -= max(0LL, (a[i]-x)/2)*2LL;
}
//for(auto p : a) cout << p << " "; cout << endl;
dp[0][a[0]]=1;
if(a[0]>=x) dp[0][a[0]-x]=1;
for (int i = 1; i < (int)a.size(); i++)
{
for (int j = 0; j <= 2*x+100; j++)
{
if(dp[i-1][j]==0) continue;
int sm = j/2;
dp[i][sm+a[i]] += dp[i-1][j];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...