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
using namespace std; struct node{ int index; int cost; int snow; node(){ } node( int _index, int _cost, int _snow){ index=_index; cost=_cost; snow=_snow; } bool operator < (const node&tmp) const{ return cost>tmp.cost; } }; int main() { int N; int M; cin>>N>>M; vector
v[N + 1]; for(int x=0; x
>a>>b>>c>>d; v[a].push_back(node(b, c, d)); v[b].push_back(node(a, c, d)); } priority_queue
pq; pq.push(node(1, 0, 1)); bool matrica[N + 1]; for(int x1=0; x1 <= N; x1++){ matrica[x1]=false; } while(!pq.empty()){ node c=pq.top(); pq.pop(); matrica[c.index]=true; if(c.index==N){ cout<
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)