Submission #150316

# Submission time Handle Problem Language Result Execution time Memory
150316 2019-09-01T08:07:46 Z distutpia(#3780, cblimmm, wooks1998) Organizing the Best Squad (FXCUP4_squad) C++17
0 / 100
3000 ms 10872 KB
#include "squad.h"
int siz;
std::vector<int> A1;
std::vector<int> D1;
std::vector<int> P1;
void Init(std::vector<int> A, std::vector<int> D, std::vector<int> P){
	int N = A.size();
	siz=N;
	A1=A;
	D1=D;
	P1=P;
}

long long BestSquad(int X, int Y){
	long long int ans=0;
	for(int i=0; i<siz; i++){
		for(int j=0; j<siz; j++){
			if(i==j){
				continue;
			}
			if(ans<(long long)(A1[i]+D1[j])*(long long)X+(long long)(P1[i]+P1[j])*(long long)Y){
				ans=(long long)(A1[i]+D1[j])*(long long)X+(long long)(P1[i]+P1[j])*(long long)Y;
			}
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
3 Execution timed out 3100 ms 10872 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Execution timed out 3099 ms 504 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
3 Execution timed out 3100 ms 10872 KB Time limit exceeded
4 Halted 0 ms 0 KB -