이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "squad.h"
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
using ll = long long;
using vi = vector<ll>;
int n;
vi a, d, p;
void Init(std::vector<int> xA, std::vector<int> xD, std::vector<int> xP){
n = xA.size();
for(auto i : xA) a.pb(i);
for(auto i : xD) d.pb(i);
for(auto i : xP) p.pb(i);
}
long long BestSquad(int X, int Y){
ll atc, def, ans = 0;
atc = def = 0;
for(int i = 0; i < n; i++) {
ans = max(ans, X*1ll*a[i] + Y*1ll*p[i] + def);
ans = max(ans, X*1ll*d[i] + Y*1ll*p[i] + atc);
atc = max(atc, X*1ll*a[i] + Y*1ll*p[i]);
def = max(def, X*1ll*d[i] + Y*1ll*p[i]);
}
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... |