# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9340 | YesUjam | Your life (kriii2_Y) | C++98 | 92 ms | 7568 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<stdio.h>
#include<queue>
#include<vector>
using namespace std;
#define M 100005
struct me{
int x,y;
bool operator < (const me &A)const{
return y>A.y;
}
};
me t,qu;
priority_queue< me > heap;
vector<int> a[M];
int n,m,re[M];
void dijkstra(int x){
int i;
t.x=x; t.y=re[x]; heap.push(t);
while(1){
if(heap.empty()) break;
t=heap.top();
heap.pop();
for(i=0;i < a[t.x].size();i++){
if(re[a[t.x][i]]==0 || re[a[t.x][i]]>re[t.x]+1){
re[a[t.x][i]]=re[t.x]+1;
qu.x=a[t.x][i]; qu.y=re[a[t.x][i]];
heap.push(qu);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |