| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1361719 | jackhui100101 | Cyberland (APIO23_cyberland) | C++20 | 9 ms | 2096 KiB |
#include "cyberland.h"
#include <bits/stdc++.h>
using namespace std;
vector<vector<double>> am(3, vector<double> (3));
double solve(int n, int m, int k, int h, vector<int> x, vector<int> y, vector<int> c, vector<int> arr){
double ans1 = 1e18, ans2 = 1e18;
for (int i = 0; i < m; i++){
am[x[i]][y[i]] = c[i];
am[y[i]][x[i]] = c[i];
}
if (h == 1){
if (am[0][1]) ans1 = am[0][1];
if (am[0][2] && am[2][1]){
if (arr[2] == 0) ans2 = am[2][1];
else if (arr[2] == 1) ans2 = am[0][2] + am[2][1];
else ans2 = am[0][2] / 2 + am[2][1];
}
}
else{
if (am[0][2]) ans1 = am[0][2];
if (am[0][1] && am[1][2]){
if (arr[1] == 0) ans2 = am[1][2];
else if (arr[1] == 1) ans2 = am[0][1] + am[1][2];
else ans2 = am[0][1] / 2 + am[1][2];
}
}
if (ans1 > 1e17 && ans2 > 1e17) return -1;
return min(ans1, ans2);
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
