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 <bits/stdc++.h>
#include "jelly.h"
//#include "grader.cpp"
#include <vector>
using namespace std;
int N;
vector<int> A;
vector<int> B;
int dp(int pos, int remx, int remy){
if(pos == 0) return 0;
int ret = dp(pos-1, remx, remy);
if(remx >= A[pos-1]){
ret = max(ret, dp(pos-1, remx-A[pos-1], remy) + 1);
}
if(remy >= B[pos-1]){
ret = max(ret, dp(pos-1, remx, remy-B[pos-1]) + 1);
}
return ret;
}
int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) {
N = a.size();
A = a;
B = b;
return dp(N, x, y);
}
# | 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... |