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 time; int cost; node(){} node(int _idx, int _time, int _cost) { idx=_idx; time=_time; cost=_cost; } bool operator<(const node &tmp) const { return time>tmp.time; } }; int d[3005][2005]; int main() { // ifstream cin("in.txt"); int s,a,n; cin>>s>>a>>n; int x,y,t,m; vector
>par[a+5]; for(int i=0;i
>x>>y>>t>>m; par[x].push_back({y,t,m}); par[y].push_back({x,t,m}); } priority_queue
Q; Q.push(node(1,0,0)); for(int i=0;i<=a;i++) { for(int j=0;j<=s;j++) { d[i][j]=2e9; } } d[1][0] = 0; while(!Q.empty()) { node teme=Q.top(); Q.pop(); 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)