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
using namespace std; struct node{ int idx; int cost; int distance; int ostanata; node(){ } node(int idx2, int cost2, int distance2, int ostanato2){ idx=idx2; cost=cost2; ostanata=ostanato2; distance=distance2; } bool operator < (const node &tmp)const{ return cost > tmp.cost; } }; int main() { int n, m, x, k, l; cin>>n>>x>>k>>l>>m; vector
>graph[n+5]; for(int i=0; i
>a>>b>>c; graph[a].push_back(make_pair(b, c)); graph[b].push_back(make_pair(a, c)); } int distance[n + 5][k + 5][l + 5]; for(int i=0; i<=n; i++){ for(int j=0; j<=k; j++){ for(int z=0; z<=l; z++){ distance[i][j][z]=2e9; } } } priority_queue
p; p.push(node(1, 0, l, k)); while(!p.empty()){ node c=p.top(); p.pop(); int nova_distanca=c.distance; if(c.idx<=x and c.distance > 0){ nova_distanca=0; } if(nova_distanca>0){ for(int i=0; i
=0 and c.cost
0){ c.ostanata--; nova_distanca=l; for(int i=0; i
=0 and c.cost
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)