// Problem: Flight Routes Check // URL: https://vjudge.net/problem/CSES-1682 // // Powered by CP Editor (https://cpeditor.org) #include<bits/stdc++.h> using namespace std; const int maxn=1e5+5; vector<
Flight Routes Check 判断是不是一个强连通图,如果不是,就找出不能到达的单程 tarjan 模板 判断不能到达的,直接从 $1$ 开始走一次搜索,如果与 $1$ 不同强连通块上的点,且 $1$ 能够到达那个点,显然答案就是从那个点到 $1$ 记得考虑整个图不连通的情况 #inclu
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...