# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
978206 | model_code | Spy 3 (JOI24_spy3) | C++17 | 81 ms | 7144 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 "Aoi.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
namespace {
const ll linf = 1LL << 60;
string encode(ll num, int len) {
string s;
for (int i = len - 1; i >= 0; i--) s.push_back('0' + (num >> i & 1));
return s;
}
// {dist, pre}
pair<vector<ll>, vector<int>> dijkstra(int n, const vector<int> &a, const vector<int> &b, const vector<ll> &c) {
vector<vector<tuple<int, ll, int>>> G(n);
for (int i = 0; i < a.size(); i++) {
if (c[i] == -1) continue;
G[a[i]].emplace_back(b[i], c[i], i);
G[b[i]].emplace_back(a[i], c[i], i);
}
vector<ll> dist(n, linf);
vector<int> pre(n, -1);
priority_queue<pair<ll, int>, vector<pair<ll, int >>, greater<>> pq;
dist[0] = 0;
pq.emplace(0, 0);
while (!pq.empty()) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |