// Problem: Flight Routes Check// URL: https://vjudge.net/problem/CSES-1682/// Powered by CP Editor (https://cpeditor.org)#include<bits/stdc++.h>usingnamespacestd;constintmaxn=1e5+5;vector<int>adj[maxn];vector<int>jda[maxn];boolvis[maxn];boolsiv[maxn];voiddfs(intu,intp){if(...
Hello. I am solving the cses problemFlight Routesbut I am getting TLE in some of the test cases. My approach: 1. use dijkstra and keep a distance array of size N*K Dijkstra's code: staticvoiddj(ArrayList<ArrayList<pair>>graph,intstart,intk,long[][]dis){ArrayDeque<pair>dq=newArrayDequ...