# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
963558 | IBory | Cyberland (APIO23_cyberland) | C++17 | 193 ms | 10632 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cyberland.h"
#include <bits/stdc++.h>
#define pii pair<ll, ll>
typedef long long ll;
using namespace std;
const int MAX = 100007;
vector<pii> G[MAX];
bool V[MAX];
ll D[MAX], LD[MAX];
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) {
for (int i = 0; i < N; ++i) G[i].clear();
for (int i = 0; i < M; ++i) {
G[x[i]].emplace_back(y[i], c[i]);
G[y[i]].emplace_back(x[i], c[i]);
}
int ok = 0;
memset(V, 0, sizeof(V));
V[0] = 1;
queue<int> Q;
Q.push(0);
while (!Q.empty()) {
int cur = Q.front(); Q.pop();
for (auto [next, _] : G[cur]) {
if (V[next]) continue;
if (next == H) {
ok = 1;
continue;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |