이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "jelly.h"
#include <bits/stdc++.h>
using namespace std;
int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) {
int n = a.size();
vector<pair<int, int>> a1, b1;
for(int i =0; i<n; i++){
a1.push_back({a[i], b[i]});
}
sort(a1.begin(), a1.end());
int ans = 0;
for(int j=0; j<n; j++){
if(a1[j].first < a1[j].second && x >= a1[j].first){
x-=a1[j].first;
ans++;
}
else if(a1[j].first == a1[j].second){
if(x<=y && y>= a1[j].second){
y-=a1[j].second;
ans++;
}
else if(x>=y && x>= a1[j].first){
x-=a1[j].first;
ans++;
}
}
else if(a1[j].first > a1[j].second && y >= a1[j].second){
y-=a1[j].second;
ans++;
}
}
return ans;
}
# | 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... |