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>
using namespace std;
int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) {
int answer = 0; int n = a.size();
// nb from b
int b_price = b[0];
answer += y / b_price;
// nb from a
sort(a.begin(), a.end());
int sum = 0; int nb_a = 0; int counter = 0;
while ((sum + a[counter]) <= x && counter < n) {
sum += a[counter];
nb_a += 1;
counter += 1;
}
answer += nb_a;
// return result
answer = min(answer, n);
return answer;
}
# | 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... |