- 博客(26)
- 收藏
- 关注
原创 2017 CCPC 杭州 B题 /hdu 6265 (状态压缩/规律)
‘解法1代码://577ms#include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long ll;const int inf = 0x3f3f3f3f;
2018-04-18 14:01:19
890
原创 Hdu 4565 So Easy! (矩阵快速幂)
So Easy!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5642 Accepted Submission(s): 1875Problem Description A sequence Sn i
2018-04-09 23:28:16
209
原创 POJ 3233 Matrix Power Series (矩阵快速幂)
Matrix Power SeriesTime Limit: 3000MS Memory Limit: 131072KTotal Submissions: 26027 Accepted: 10705DescriptionGiven a n × n matrix A and a positive integer k,
2018-04-09 23:24:20
174
原创 HDU 1757 A Simple Math Problem (矩阵快速幂)
A Simple Math ProblemTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5686 Accepted Submission(s): 3481Problem DescriptionLele
2018-04-09 23:22:17
137
原创 ZOJ 3872 Beauty of Array (DP)
Beauty of ArrayTime Limit: 2 Seconds Memory Limit: 65536 KBEdward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array.
2018-04-08 11:57:00
142
原创 Codeforces Round #451 (Div. 2) B 拓展欧几里得
B. Proper Nutritiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has n burles. One bottle of Ber-Co
2017-12-17 18:56:52
275
原创 2017 ACM-ICPC 亚洲区(西安赛区)网络赛 B Coin(逆元,费马小定理)
Bob has a not even coin, every time he tosses the coin, the probability that the coin's front face up is \frac{q}{p}(\frac{q}{p} \le \frac{1}{2})pq(pq≤21).The question is, when Bob
2017-09-30 18:27:40
247
原创 POJ 3761 Bubble Sort
Bubble SortTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2842 Accepted: 982DescriptionBubble sort is a simple sorting algorithm. It works by repeate
2017-09-26 23:25:28
322
原创 Codeforces 7C Line(拓展欧几里得)
C. Linetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA line on the plane is described by an equation Ax +
2017-09-26 23:12:14
734
原创 POJ 1061 青蛙的约会 (拓展欧几里得)
青蛙的约会Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 119313 Accepted: 25121Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直
2017-09-26 22:51:10
198
原创 HDU 3501 Calculation 2 (欧拉函数)
Calculation 2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
2017-09-26 22:18:12
210
原创 HDU 2588 GCD (欧拉函数)
GCD Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
2017-09-26 22:10:29
183
原创 POJ 2470 Relatives (欧拉函数)
RelativesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15269 Accepted: 7731DescriptionGiven n, a positive integer, how many positive integers less t
2017-09-26 22:02:09
195
原创 POJ 1523 SPF(割点,分块,tarjan)
题目链接:http://poj.org/problem?id=1523题目大意:问你图中有哪些割点,并且这些割点能将图分成几块思路:因为是无向图且没有重边,tarjan判断下是否为割点就可以了,如果是根节点,且根节点有多于一棵子树,则根节点是割点,若不是根节点且存在u的孩子使得dfn[u]是子树的个数,其他是孩子个数加上父亲的个数,也就是孩子数+1上代码:#in
2017-09-21 14:25:32
245
原创 POJ 3177 Redundant Paths(边双连通分量+tarjan)
题目链接:http://poj.org/problem?id=3177题目大意:给你一个连通图,问你最少添加几条边能组成一个边双连通图,有重边思路:我们将所有的双连通块看成一个点,因为他们是连通的且不成一个环,利用tarjan缩点后就可以看做一棵树这样的树至少需要加多少条边就能构成一个双连通图呢,我们只需要将叶子节点连起来即可,因为是无向图,所以度为1的就是叶节点而不是度为0,这样
2017-09-21 13:30:38
197
原创 HDU 3836 Equivalent Sets(强连通+缩点,tarjan)
Equivalent Sets Time Limit: 12000/4000 MS (Java/Others) Memory Limit: 104857/104857 K (Java/Others) T
2017-09-12 10:25:49
204
原创 Codeforces Round #427 (Div. 2) C. Star sky
C. Star skytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Cartesian coordinate system is set in the s
2017-08-04 17:34:18
283
原创 HDU 4027 Can you answer these queries?(线段树求区间和)
Can you answer these queries? A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of
2017-08-04 16:02:19
245
原创 HDU 1540 Tunnel Warfare (线段树,区间合并)
Tunnel WarfareTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9270 Accepted Submission(s): 3609Problem DescriptionDuring the
2017-08-04 15:09:14
202
原创 FZU 2271 X(Floyd)
Problem 2271 XAccept: 166 Submit: 584Time Limit: 1500 mSec Memory Limit : 32768 KB Problem DescriptionX is a fully prosperous country, especially known for its complicated transp
2017-08-04 14:13:49
358
原创 HDU 2923 Einbahnstrasse(最短路径,多源点到单源点)
EinbahnstrasseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3735 Accepted Submission(s): 1184Problem DescriptionEinbahnstra
2017-08-04 13:09:27
304
原创 HDU 1535 Invitation Cards(多源点到单源点,dijkstra/spfa)
Invitation CardsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4417 Accepted Submission(s): 2013Problem DescriptionIn the a
2017-08-04 12:39:09
270
原创 POJ 3660 Cow Contest (简单floyd)
N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is un
2017-07-27 15:41:29
200
原创 HDU 3790 简单最短路径问题(dijkstra+双重权值)
给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1Output输出 一行有两个数, 最短距
2017-07-27 14:10:51
287
原创 POJ 1847 Tram (简单最短路径dijkstra-floyd-spfa)
题目链接:http://poj.org/problem?id=1847大意:给你N个交叉路口,每个路口都对应几个路口,第一个不用开关,其余要扳动开关,S到T,问你需要扳动几次开关思路:把第一个赋值为0,其余为1,进行最短路径算法上代码
2017-07-27 13:50:09
272
原创 Codeforces Round #425 (Div. 2) B. Petya and Exam
B. Petya and Examtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt's hard times now. Today Petya needs to
2017-07-25 17:57:38
250
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人