# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789227 | LIF | Jelly Flavours (IOI20_jelly) | C++14 | 97 ms | 3692 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "jelly.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
int pricea[300005];
int priceb[300005];
int dp[505][505];
int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) {
for(int i=0;i<a.size();i++)pricea[i+1] = a[i];
for(int i=0;i<b.size();i++)priceb[i+1] = b[i];
dp[0][0] = 0;
int n = a.size();
for(int i=1;i<=n;i++)
{
for(int j=x;j>=0;j--)
{
for(int k=y;k>=0;k--)
{
if(j >= pricea[i])dp[j][k] = max(dp[j-pricea[i]][k] + 1, dp[j][k]);
if(k >= priceb[i])dp[j][k] = max(dp[j][k-priceb[i]]+1,dp[j][k]);
}
}
}
int maxx = 0;
for(int j=0;j<=x;j++)
{
for(int k=0;k<=y;k++)
{
maxx = max(maxx,dp[j][k]);
}
}
return maxx;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |