# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9165 | hodduc | Your life (kriii2_Y) | C++98 | 84 ms | 8232 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.
// Implementation of Dijkstra's algorithm using adjacency lists
// and priority queue for efficiency.
//
// Running time: O(|E| log |V|)
#include <queue>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
const int INF = 2000000000;
typedef pair<int,int> PII;
int main(){
int N, s, t, M;
int a, b;
scanf("%d %d", &N, &M);
s = 0; t = N-1;
vector<vector<PII> > edges(N);
for (int i = 0; i < M; i++){
scanf("%d %d", &a, &b);
edges[a-1].push_back(make_pair(1, b-1));
}
// use priority queue in which top element has the "smallest" priority
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |