Submission #751022

# Submission time Handle Problem Language Result Execution time Memory
751022 2023-05-30T19:56:42 Z Rejep Cyberland (APIO23_cyberland) C++17
15 / 100
3000 ms 7112 KB
#include "cyberland.h"



#include<bits/stdc++.h>

#define db double

#define pb push_back

using namespace std;

const db INF=1e18+1;





double solve(int n, int m, int k, int h, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) {

	vector<vector<pair<int,db>>>g(n);

	for (int i=0; i<m; i++){

		g[x[i]].pb({y[i],c[i]});

		g[y[i]].pb({x[i],c[i]});

	}

 

	vector<db> d (n, INF),  p (n);

	d[0] = 0;

	vector<bool> u (n, 0);

	for (int i=0; i<n; ++i) {

		int v = -1;

		for (int j=0; j<n; ++j)

			if (!u[j] && (v == -1 || d[j] < d[v]))

				v = j;

		if (d[v] == INF)

			break;

		u[v] = true;

 

		for (size_t j=0; j<g[v].size(); ++j) {

			int to = g[v][j].first,

				len = g[v][j].second;

			if (d[v] + len < d[to]) {

				d[to] = d[v] + len;

				p[to] = v;

			}

		}

	}

	

	if (d[h]==INF)return -1;

	else return d[h];

}
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 468 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 100 ms 480 KB Correct.
2 Correct 121 ms 460 KB Correct.
3 Correct 112 ms 460 KB Correct.
4 Correct 123 ms 340 KB Correct.
5 Correct 116 ms 436 KB Correct.
6 Correct 752 ms 1536 KB Correct.
7 Correct 926 ms 1472 KB Correct.
8 Correct 1183 ms 2644 KB Correct.
9 Correct 37 ms 340 KB Correct.
10 Correct 33 ms 400 KB Correct.
# Verdict Execution time Memory Grader output
1 Incorrect 113 ms 412 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3050 ms 7112 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 55 ms 436 KB Correct.
2 Correct 59 ms 420 KB Correct.
3 Correct 64 ms 456 KB Correct.
4 Correct 352 ms 1260 KB Correct.
5 Correct 25 ms 340 KB Correct.
# Verdict Execution time Memory Grader output
1 Incorrect 71 ms 448 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 396 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 59 ms 468 KB Wrong Answer.
2 Halted 0 ms 0 KB -