oatuwwutao
oatuwwutao
全部文章
分类
未归档(4)
竞赛(1)
题解(12)
归档
标签
去牛客网
登录
/
注册
oatuwwutao的博客
全部文章
(共17篇)
2018 ECNA Regional Contest J.
题目链接:Watch Where You Step 题意 给定有向图的邻接矩阵,现在需要给该图增加边,使得如果两点可达必直接可达,求需要加边的数量。 题解 首先,如果给定 个结点的图中任意两点均可达,那么需要增加的边数为有向完全图的边数 原来有的边数。 所以先将图分解为多个强连通分量,然后将强连...
DFS
ACM刷题
图论
强连通分量
2019-08-14
0
704
2017 ICPC Urumqi A.coins (期望)
题目链接: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 tab...
2019-08-10
0
579
HDU 1548 A strange lift (BFS)
题目链接: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 <= Ki <= N) ...
2019-08-06
0
462
HDU 2266 How Many Equations Can You Find (DFS)
题目链接: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 ’-’ betwee...
2019-08-06
0
493
POJ 3641 Pseudoprime numbers (数论+快速幂)
题目链接: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 ...
2019-08-06
0
447
POJ-1995-Raising-Modulo-Numbers-快速幂
题目链接:POJ 1995 Description People are different. Some secretly read magazines full of interesting girls' pictures, others create an A-bomb in thei...
2019-08-06
0
587
快速幂取模算法
问题引入 快速幂用于求解 \(a ^ n\ mod\ m\) 的结果。 朴素的做法是直接用循环求解,时间复杂度 \(O(n)\)。 typedef long long ll; ll power(ll a, ll n, ll m) { ll result = 1; for...
2019-08-06
0
462
首页
上一页
1
2
下一页
末页