码迷,mamicode.com
首页 >  
搜索关键字:acm 拓扑排序    ( 20088个结果
如何求拓扑排序的所有种类及种类数
sample input 9 10 0 1 1 3 2 4 3 2 3 6 5 4 6 5 7 5 8 6 8 7 sample output 0 1 3 2 8 6 7 5 4 0 1 3 2 8 7 6 5 4 0 1 3 8 2 6 7 5 4 0 1 3 8 2 7 6 5 4 0 1 3 ...
分类:编程语言   时间:2020-04-17 18:35:52    阅读次数:105
HDU2553 N皇后问题(dfs)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2553 Problem Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的 ...
分类:其他好文   时间:2020-04-16 19:23:08    阅读次数:70
【hdu4785】【闵可夫斯基和】 Exhausted Robot
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4785 题意:一个房间(矩形),里面有一些家具(凸多边形),你有一个扫地机器(凸多边形),扫地机器可以扫地是它的第一个点,能扫地条件是机器完全在房间里面并且和家具没有交(机器可以穿过家具,但穿过的时候不能 ...
分类:其他好文   时间:2020-04-16 15:40:44    阅读次数:86
NC201400 树学题解
一.题解 ? 这道题又是一道换根dp板子题,代码结构与 "Accumulation Degree" 这道题基本一致,唯一不同的就是转移了【不过转移的时候,因为方程的原因不需要特殊考虑叶节点】 ? 我们先套路的设$dp[i]$ 表示以 $i$ 为根的子树中 , 所有点的深度和 ,现在,我们来想想转移。 ...
分类:其他好文   时间:2020-04-13 12:33:24    阅读次数:53
【hdu 1789】 Doing Homework again
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Descripti ...
分类:其他好文   时间:2020-04-12 19:01:30    阅读次数:77
2019-2020 ACM-ICPC Latin American Regional Programming Contest A- Algorithm Teaching 二分图
``` #include #define f first #define s second using namespace std; typedef long long ll; const int N=300005; typedef pair P; int n,tot,t,V; map mp; ma... ...
分类:其他好文   时间:2020-04-12 18:18:38    阅读次数:100
HDU4612 Warm up
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4612 题意:给定一个无向图,问加一条边后最少的桥数是多少。 思路:找出边双连通分量后缩点成一棵树,然后我们要是加一条边使桥数最少,显然是去找树的直径,所以两边DFS去找树的直径即可,注意这里很坑,重边是 ...
分类:其他好文   时间:2020-04-11 23:30:08    阅读次数:65
HDoj 2052 Picture
Problem Description Give you the width and height of the rectangle,darw it. Input Input contains a number of test cases.For each case ,there are two n ...
分类:其他好文   时间:2020-04-11 23:29:43    阅读次数:97
HDU-5963 朋友 思维
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5963 吐槽 这道题我第一眼看,嗯??博弈论?还是树上的?我好像不会啊。。。但是一想某人的话,感觉这个应该也不会太难,可能有规律 分析 于是我就从样例开始仔细思考~~找规律~~,第一个样例应该是看不出来啥, ...
分类:其他好文   时间:2020-04-11 22:09:21    阅读次数:63
4.11 每日一题题解
完全平方数 + 题目链接: "https://ac.nowcoder.com/acm/contest/37/A" 涉及知识点: + 暴力/二分 solution: + $祝大家周末愉快$ + $[1,n]区间的完全平方数的个数等于$ $\sqrt{n}$ + $[L,R]区间的完全平方数的个数可以理 ...
分类:其他好文   时间:2020-04-11 10:18:41    阅读次数:63
20088条   上一页 1 ... 26 27 28 29 30 ... 2009 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!