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 distance; int cena; int index; node(){ } node(int _index, int _distance, int _cena){ index=_index; distance=_distance; cena=_cena; } bool operator <(const node&tmp)const{ return distance > tmp.distance; } }; int main() { int n; int m; int S; int S1=200000000; cin>>S; cin>>n>>m; int matrica[n+1][S + 1]; vector
v[n+1]; for(int x1=0; x1
>indexa>>indexb>>distance>>cost; v[indexa].push_back(node(indexb, distance, cost)); v[indexb].push_back(node(indexa, distance, cost)); } priority_queue
pq; pq.push(node(1, 0, 0)); matrica[1][0]=0; while(!pq.empty()){ node cnode=pq.top(); pq.pop(); for(int h=0; h
distance+cnode.distance)){ matrica[sosed][cena+cnode.cena]=distance+cnode.distance; pq.push(node(sosed, distance+cnode.distance, cena+cnode.cena)); } } } for(int y=0; y<=S; y++){ if(matrica[n][y]
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)