답안 #762498

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
762498 2023-06-21T12:42:38 Z goodbyehanbyeol 최적의 팀 구성 (FXCUP4_squad) C++17
19 / 100
3000 ms 36544 KB
#include "squad.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, dcond;
ll atk[300002], def[300002], pop[300002];

void Init(vector<int> A, vector<int> D, vector<int> P){
	n = (int)A.size(), dcond = 1;
	for(int i=1; i<=n; i++){
        atk[i] = A[i-1];
        def[i] = D[i-1];
        pop[i] = P[i-1];
        if(def[i] != 1) dcond = 0;
	}

	if(dcond){

	}
}

ll BestSquad(int X, int Y){
	if(true){
        vector<pair<ll, int> > atkVec, defVec;
        for(int i=1; i<=n; i++) atkVec.push_back(make_pair(atk[i]*X+pop[i]*Y, i));
        for(int i=1; i<=n; i++) defVec.push_back(make_pair(def[i]*X+pop[i]*Y, i));
        sort(atkVec.rbegin(), atkVec.rend());
        sort(defVec.rbegin(), defVec.rend());
        if(atkVec[0].second != defVec[0].second) return atkVec[0].first + defVec[0].first;
        else return max(atkVec[0].first + defVec[1].first, atkVec[1].first + defVec[0].first);
	}
	else{

	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 136 ms 36508 KB Output is correct
4 Correct 131 ms 36500 KB Output is correct
5 Correct 11 ms 2532 KB Output is correct
6 Correct 129 ms 36544 KB Output is correct
7 Correct 131 ms 36512 KB Output is correct
8 Correct 128 ms 36504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 308 KB Output is correct
2 Correct 757 ms 724 KB Output is correct
3 Execution timed out 3099 ms 35020 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 136 ms 36508 KB Output is correct
4 Correct 131 ms 36500 KB Output is correct
5 Correct 11 ms 2532 KB Output is correct
6 Correct 129 ms 36544 KB Output is correct
7 Correct 131 ms 36512 KB Output is correct
8 Correct 128 ms 36504 KB Output is correct
9 Correct 1 ms 308 KB Output is correct
10 Correct 757 ms 724 KB Output is correct
11 Execution timed out 3099 ms 35020 KB Time limit exceeded
12 Halted 0 ms 0 KB -