# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
758958 | Dexva | Voting Cities (NOI22_votingcity) | C++14 | 7 ms | 724 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;
#define lln long long
#define INF 0x3f3f3f3f
using pii = pair<int, int>;
struct edge {
int v;
int weight;
};
int main() {
int n, e; cin >> n >> e;
vector< vector<edge> > adj(n);
for (int i=0;i<e;i++) {
int u, v, w;
cin >> u >> v >> w;
adj[u].push_back({v,w}); //insert the edge essentially
adj[v].push_back({u,w}); //if undirected graph only
}
int source; cin >> source;
vector<int> d(n, INF); // or use numeric_limits<int>::max()
vector<bool> done(n);
priority_queue<pii, vector<pii>, greater<pii> > pq;
pq.push({0, source});
d[source] = 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |