# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1048361 | TAhmed33 | Cities (BOI16_cities) | C++98 | 1332 ms | 74792 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 <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,fma,bmi,bmi2,popcnt,lzcnt")
const int MAXN = 2e5 + 25;
typedef long long ll;
const ll inf = 1e16;
vector <pair <int, int>> adj[MAXN];
int n, m, k;
int s[5]; int ind[MAXN];
ll dist[1 << 5][MAXN];
void solve () {
cin >> n >> k >> m;
memset(ind, -1, sizeof(ind));
for (int i = 0; i < k; i++) {
cin >> s[i]; ind[s[i]] = i;
}
for (int i = 1; i <= m; i++) {
int a, b, c; cin >> a >> b >> c;
adj[a].push_back({b, c});
adj[b].push_back({a, c});
}
for (int j = 1; j <= n; j++) {
for (int i = 0; i < (1 << k); i++) {
dist[i][j] = inf;
}
}
for (int i = 0; i < k; i++) {
dist[1 << i][s[i]] = 0;
}
# | 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... |