| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 150609 | TLEWA맞 (#200) | 최적의 팀 구성 (FXCUP4_squad) | C++17 | 5 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "squad.h"
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
#define inf 1e18
typedef long long LL;
int n;
vector<int> a, d, p;
void Init(std::vector<int> A, std::vector<int> D, std::vector<int> P){
n=A.size();
a=A;
d=D;
p=P;
}
long long BestSquad(int X, int Y){
LL maxx11=0, maxx21=0, maxx12=0, maxx22=0;
int maxnum1, maxnum2;
for(int i=0; i<n; i++){
if(maxx12<(LL)X*a[i]+(LL)Y*p[i]){
if(maxx11<(LL)X*a[i]+(LL)Y*p[i]){
maxx12=maxx11;
maxx11=(LL)X*a[i]+(LL)Y*p[i];
maxnum1=i;
}
else maxx12=(LL)X*a[i]+(LL)Y*p[i];
}
}
for(int i=0; i<n; i++){
if(maxx22<(LL)X*a[i]+(LL)Y*p[i]){
if(maxx12<(LL)X*a[i]+(LL)Y*p[i]){
maxx22=maxx21;
maxx21=(LL)X*a[i]+(LL)Y*p[i];
maxnum2=i;
}
else maxx22=(LL)X*a[i]+(LL)Y*p[i];
}
}
if(maxnum1!=maxnum2)return maxx11+maxx21;
return max(maxx11+maxx22, maxx12+maxx22);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
