Submission #975078

#TimeUsernameProblemLanguageResultExecution timeMemory
975078LucaIliePacking Biscuits (IOI20_biscuits)C++17
44 / 100
11 ms1220 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; const int k = 60; long long sum[k], dp[k]; long long count_tastiness( long long x, vector <long long> a ) { a.resize( k ); dp[0] = 1; for ( int i = 1; i < k; i++ ) { a[i] = a[i - 1] + (a[i] << i); dp[i] = 1; long long r = 1e18; for ( int j = i - 1; j >= 0; j-- ) { r = min( r, a[j] ); if ( x <= (r >> j) ) { dp[i] += dp[j]; r -= (x << j); } } } return dp[k - 1]; }
#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...