Submission #987339

#TimeUsernameProblemLanguageResultExecution timeMemory
987339AdamGSPacking Biscuits (IOI20_biscuits)C++17
42 / 100
1045 ms37512 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include "biscuits.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(a, b) for(int a = 0; a < (b); ++a) unordered_map<ll,ll>dp[65]; vector<ll>T; ll x; ll solve(ll a, ll b) { if(a==T.size()) return b/x+1; b+=T[a]; if(dp[a][b]) return dp[a][b]; dp[a][b]=solve(a+1, b/2); if(b>=x) dp[a][b]+=solve(a+1, (b-x)/2); return dp[a][b]; } ll count_tastiness(ll _x, vector<ll>_T) { T=_T; x=_x; rep(i, T.size()) dp[i].clear(); return solve(0, 0); }

Compilation message (stderr)

biscuits.cpp: In function 'll solve(ll, ll)':
biscuits.cpp:12:7: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   if(a==T.size()) return b/x+1;
      |      ~^~~~~~~~~~
biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:7:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 | #define rep(a, b) for(int a = 0; a < (b); ++a)
      |                                    ^
biscuits.cpp:21:3: note: in expansion of macro 'rep'
   21 |   rep(i, T.size()) dp[i].clear();
      |   ^~~
#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...