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 n = a.size(); int counter = 0; int answer = 0;
if (x > y) swap(x, y);
sort(a.begin(), a.end());
int sum_x = 0;
while ((sum_x + a[counter]) <= x && counter < n) {
sum_x += a[counter];
answer += 1; counter += 1;
}
int sum_y = 0;
while ((sum_y + a[counter]) <= y && counter < n) {
sum_y += a[counter];
answer += 1; counter += 1;
}
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... |