随笔分类 -  竞赛

上一页 1 ··· 4 5 6 7 8
摘要:题目链接: "HDU 2553" Problem Description 在 $N N$ 的方格棋盘放置了 $N$ 个皇后,使得它们不相互攻击(即任意 $2$ 个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成 $45$ 角的斜线上。 你的任务是,对于给定的 $N$,求出有多少种合法的放置方法 阅读全文
posted @ 2019-08-14 20:43 wuli涛涛 阅读(181) 评论(0) 推荐(0)
摘要:2019 杭电多校 5 1005 题目链接: "HDU 6628" 比赛链接: "2019 Multi University Training Contest 5" Problem Description A sequence of length $n$ is called a permutatio 阅读全文
posted @ 2019-08-14 20:15 wuli涛涛 阅读(277) 评论(0) 推荐(0)
摘要:2019 杭电多校 7 1011 题目链接: "HDU 6656" 比赛链接: "2019 Multi University Training Contest 7" Problem Description Cuber QQ always envies those Kejin players, who 阅读全文
posted @ 2019-08-14 00:00 wuli涛涛 阅读(598) 评论(2) 推荐(2)
摘要:比赛链接: "2016 ICPC Mid Central USA Region" 题目链接: "Windy Path" Description Consider following along the path in the figure above, starting from $(4,4)$ an 阅读全文
posted @ 2019-08-13 19:47 wuli涛涛 阅读(258) 评论(0) 推荐(0)
摘要:Description You have $N$ integers, $A_1, A_2, ... , A_N$. You need to deal with two kinds of operations. One type of operation is to add some given nu 阅读全文
posted @ 2019-08-12 22:30 wuli涛涛 阅读(171) 评论(0) 推荐(0)
摘要:2019 杭电多校 7 1006 题目链接: "HDU 6651" 比赛链接: "2019 Multi University Training Contest 7" Problem Description Final Exam is coming! Cuber QQ has now one nigh 阅读全文
posted @ 2019-08-12 20:43 wuli涛涛 阅读(262) 评论(0) 推荐(0)
摘要:题目链接: "Watch Where You Step" 题意 给定有向图的邻接矩阵,现在需要给该图增加边,使得如果两点可达必直接可达,求需要加边的数量。 题解 首先,如果给定 $n$ 个结点的图中任意两点均可达,那么需要增加的边数为有向完全图的边数 $n (n 1) $ 原来有的边数。 所以先将图 阅读全文
posted @ 2019-08-12 10:48 wuli涛涛 阅读(261) 评论(0) 推荐(0)
摘要:题目链接: "Coins" Description Alice and Bob are playing a simple game. They line up a row of nn identical coins, all with the heads facing down onto the t 阅读全文
posted @ 2019-08-10 20:37 wuli涛涛 阅读(209) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-08-09 22:54 wuli涛涛 阅读(3) 评论(0) 推荐(0)
摘要:题目链接: "HDU 1548" Description There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 Here comes the probl 阅读全文
posted @ 2019-08-06 21:41 wuli涛涛 阅读(184) 评论(0) 推荐(0)
摘要:题目链接: "HDU 2266" Description Now give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’ ’ between 阅读全文
posted @ 2019-08-06 21:40 wuli涛涛 阅读(146) 评论(0) 推荐(0)
摘要:题目链接: "POJ 3641" Description Fermat's theorem states that for any prime number p and for any integer a 1, ap = a (mod p). That is, if we raise a to th 阅读全文
posted @ 2019-08-06 21:39 wuli涛涛 阅读(169) 评论(0) 推荐(0)
摘要:题目链接: "POJ 1995" Description People are different. Some secretly read magazines full of interesting girls' pictures, others create an A bomb in their 阅读全文
posted @ 2019-08-06 20:16 wuli涛涛 阅读(216) 评论(0) 推荐(0)
摘要:问题引入 快速幂用于求解 $a ^ n\ mod\ m$ 的结果。 朴素的做法是直接用循环求解,时间复杂度 $O(n)$。 可以发现上述代码有重复部分,还可以简化。 进一步优化 相关题目 "POJ 1995" 阅读全文
posted @ 2019-08-06 17:47 wuli涛涛 阅读(425) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8