传送门 题意简述:给出一张DAGDAGDAG,要求删去不超过kkk条边问最后拓扑序的最大字典序是多少. 思路:贪心帮当前不超过删边上限且权值最大的点删边,用线段树维护一下每个点的入度来支持查询即可. 注意要在选点的时候更新后继的入度 代码: #include<bits/stdc++.h> #define ri register int using namespace std; inline int read(){ int ans=0; char ch=getchar(); while(!isd…
传送门 题意简述:给出一个序列,支持把ppp~nnn中所有小于等于apa_pap的'扯出来排序之后再放回去,要求动态维护全局逆序对. 思路:我们令fif_ifi表示第iii个位置之后比它大的数的个数,考虑到一个数在排一次序之后fif_ifi就变成了000,因此等价于每个位置最多修改一次,我们用树状数组先求出fif_ifi,然后上线段树来暴力修改即可. 代码: #include<bits/stdc++.h> #define ri register int using namespace…
DZY Loves Topological Sorting Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 866 Accepted Submission(s): 250 Problem Description A topological sort or topological ordering of a directed g…
DZY Loves Topological Sorting Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1250 Accepted Submission(s): 403 Problem Description A topological sort or topological ordering of a directed g…
DZY Loves Topological Sorting Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5195 Description A topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that for ev…
传送门 DZY Loves Topological Sorting Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 221 Accepted Submission(s): 52 Problem Description A topological sort or topological ordering of a directed…
DZY Loves Fibonacci Numbers Time Limit:4000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Appoint description: System Crawler (2014-07-14) Description In mathematical terms, the sequence Fn of Fibonacci numbers is defi…