Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
#include
#include
#include
#include
#define ll long long #define ps push_back using namespace std; struct node{ int idx; ll shortest_path; node(int i,ll s){ idx = i; shortest_path = s; } bool operator < (const node &tmp) const { return shortest_path > tmp.shortest_path; } }; vector
> graph[100050]; int main() { int n,m; cin >>n >> m; for(int i = 0;i
> a >> b>> c; graph[a].push_back(make_pair(b, c)); // graph[b].push_back(make_pair(a, c)); } priority_queue
pq; vector
dist(n+1,1e18); vector
visited(n+1,false); dist[1] = 0; pq.push(node(1,0)); while(!pq.empty()){ node curr = pq.top(); pq.pop(); if(visited[curr.idx]) continue; visited[curr.idx] = true; for(int j = 0;j
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)