Submission #561573

#TimeUsernameProblemLanguageResultExecution timeMemory
561573PiejanVDCJelly Flavours (IOI20_jelly)C++17
44 / 100
1384 ms2097152 KiB
#include <bits/stdc++.h> #include "jelly.h" using namespace std; int find_maximum_unique(int x, int y, vector<int>a, vector<int>b) { const int n = (int)a.size(); vector<vector<vector<int>>>dp(n+1, vector<vector<int>>(x+1, vector<int>(y+1, 0))); int ans = 0; for(int i = 1 ; i <= n ; i++) { for(int j = 0 ; j <= x ; j++) { for(int k = 0 ; k <= y ; k++) { dp[i][j][k] = max(dp[i][j][k], dp[i-1][j][k]); if(j >= a[i-1]) dp[i][j][k] = max(dp[i][j][k], 1 + dp[i-1][j - a[i-1]][k]); if(k >= b[i-1]) dp[i][j][k] = max(dp[i][j][k], 1 + dp[i-1][j][k - b[i-1]]); ans = max(ans, dp[i][j][k]); } } } return ans; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...