Submission #984435

# Submission time Handle Problem Language Result Execution time Memory
984435 2024-05-16T16:27:58 Z Abdalaziz_Alshami Cyberland (APIO23_cyberland) C++17
0 / 100
23 ms 2384 KB
#include "cyberland.h"
#include<bits/stdc++.h>
using namespace std;
double solve(int N, int M, int K, int H, std::vector<int> x, std::vector<int> y, std::vector<int> c, std::vector<int> arr) {
	if(M==0) return -1;
	if(N==2) return double(c[0]);
    double a=2e9,b=2e9,s=2e9,ans=0;
    for(int i=0;i<M;i++){
		if((x[i]==0&&y[i]==H)||(x[i]==H&&y[i]==0)) s=c[i];
		if((x[i]==0&&y[i]==(H^3))||(x[i]==(H^3)&&y[i]==0)){
			if(arr[(H^3)]==0) b=0;
			else if(arr[(H^3)]==2) b=1.0*c[i]/2;
		}
		if((x[i]==(H^3)&&y[i]==H)||(x[i]==H&&y[i]==(H^3))) a=c[i];
		double u=a+b,v=s;
		ans=min(u,v);
		if(ans>1e9) ans=-1;
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 860 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 1368 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 1372 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 2384 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 1372 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 1476 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 1372 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 1268 KB Wrong Answer.
2 Halted 0 ms 0 KB -