# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1105261 | ThegeekKnight16 | Spy 3 (JOI24_spy3) | C++17 | 1059 ms | 2384 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>
#include "Aoi.h"
using namespace std;
typedef long long ll;
const ll INF = 0x3f3f3f3f3f3f3f3f;
void dijkstraAOI123(int S, const vector<vector<tuple<int, ll, int, int>>> &grafo, const vector<bool> &MarcRuim, vector<int> &MarcMuda)
{
int N = grafo.size();
vector<ll> Dist(N, INF), pai(N);
set<pair<ll, int>> fora;
fora.emplace(Dist[S] = 0LL, S);
while (!fora.empty())
{
auto [d, v] = *fora.begin(); fora.erase(fora.begin());
if (v != 0) MarcMuda[pai[v]] ^= 1;
for (auto [viz, p, i, id] : grafo[v])
{
if (Dist[viz] > d + p)
{
fora.erase(make_pair(Dist[viz], viz));
fora.emplace(Dist[viz] = d + p, viz); pai[viz] = i;
}
}
}
fora.clear(); fill(Dist.begin(), Dist.end(), INF);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |