| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|
| 150726 | | 오리버스부릉부릉 (#200) | 최적의 팀 구성 (FXCUP4_squad) | C++17 | | 210 ms | 17724 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 "squad.h"
#include <algorithm>
#include <functional>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<ll, int> pli;
vector<pli> k;
vector<int> aa, bb, cc;
int n;
void Init(std::vector<int> a, std::vector<int> b, std::vector<int> c){
n = a.size();
aa = a; bb = b; cc = c;
}
long long BestSquad(int x, int y){
ll mav = 0;
for (int i = 0; i < n; i++)
k.push_back({ (ll)x * bb[i] + (ll)y * cc[i], i });
sort(all(k), greater<pli>());
for (int i = 0; i < n; i++) {
if (i != k[0].second) {
mav = max(mav, k[0].first + aa[i] * (ll)x + cc[i] * (ll)y);
}
else {
mav = max(mav, k[1].first + aa[i] * (ll)x + cc[i] * (ll)y);
}
}
return mav;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |