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
using namespace std; struct node { int idx; int dis; int snow; node(){} node(int _idx, int _dis, int _snow) { idx=_idx; dis=_dis; snow=_snow; } bool operator < (const node &tmp) const { return dis > tmp.dis; } }; int main() { int a,n,x,y,d,s; cin>>a>>n; vector
>par[n+5]; for(int i=0;i
>x>>y>>d>>s; par[x].push_back({y,d,s}); par[y].push_back({x, d, s}); } priority_queue
Q; Q.push(node(1, 0, 1)); bool vis[a+5]; int pat[a+5]; for(int i=0; i<=a; i++) { vis[i]=false; } for(int i = 0; i <= a; i++) { pat[i]=2e9; } pat[1]=0; while(!Q.empty()) { node teme=Q.top(); Q.pop(); vis[teme.idx]=true; // cout << teme.idx << endl; if(teme.idx == a and teme.snow == 1) { cout << teme.dis << endl; cout << "DA" << endl; return 0; } if(teme.idx == a and teme.snow == 0) { cout << teme.dis << endl; cout << "NE" << endl; return 0; } for(int i=0;i
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)