# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
783997 | ZHIRDILBILDIZ | Cyberland (APIO23_cyberland) | C++17 | 0 ms | 0 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 "cyberland.h"
#define ll long long
#define fi first
#define se second
using namespace std ;
const int N = 1e5 ;
bool us[N] ;
double dist[N] ;
vector<pair<int, int>> v[N] ;
set<pair<double, int>> s ;
void deikstra()
{
for(int i = 0 ; i < N ; i++)
dist[i] = 1e18 ;
for(auto i : s)
dist[i.se] = 0 ;
while(s.size())
{
pair<double, int> p = *s.begin() ;
s.erase(s.begin()) ;
if(us[p.se])
continue ;
us[p.se] = 1 ;
for(auto i : v[p.se])
{
if(us[i.fi] || dist[i.fi] <= p.fi + i.se)
continue ;
dist[i.fi] = p.fi + i.se ;
s.insert({dist[i.fi], i.fi}) ;