(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #480097

#TimeUsernameProblemLanguageResultExecution timeMemory
480097couplefirePacking Biscuits (IOI20_biscuits)C++17
100 / 100
58 ms1320 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int K = 60; map<int, int> dp[K]; int bound[K]; int dfs(int pos, int bd){ if(bd<0) return 0; if(pos<0) return 1; if(dp[pos].count(bd)) return dp[pos][bd]; return dp[pos][bd] = dfs(pos-1, min(bd, bound[pos-1]))+dfs(pos-1, min(bd-(1ll<<pos), bound[pos-1])); } int count_tastiness(int x, vector<int> cnt){ cnt.resize(K); int cur = 0; for(int i = 0; i<K; ++i) cur += cnt[i]*(1ll<<i), bound[i] = min(cur/x, (1ll<<(i+1))-1), dp[i].clear(); return dfs(K-1, bound[K-1]); }

Compilation message (stderr)

biscuits.cpp: In function 'long long int dfs(long long int, long long int)':
biscuits.cpp:11:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   11 |     if(bd<0) return 0; if(pos<0) return 1;
      |     ^~
biscuits.cpp:11:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   11 |     if(bd<0) return 0; if(pos<0) return 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...