题意:给你一张DAG,求图中的最长路径. 题解:用拓扑排序一个点一个点的拿掉,然后dp记录步数即可. 代码: int n,m; int a,b; vector<int> v[N]; int in[N]; int dp[N]; int main() { //ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); n=read(); m=read(); for(int i=1;i<=m;++i){ a=read(); b=read(); v[a…
Sorting It All Out Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 39602 Accepted: 13944 Description An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from s…