自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Source_Roc

编程能让我的思维更加清晰!

  • 博客(367)
  • 资源 (1)
  • 收藏
  • 关注

原创 ACMer思考

从大一寒假开始接触算法竞赛,到现在是一名正式的ACM选手,中间有的不仅是累,更多的是收获的知识、能力和友谊。收获:对不同问题的使用不同思考方式和解决方式,学习思维的转变,从开始的被动接受知识到现在的主动获取知识,从一开始的不求甚解,到现在对每个细节的都有要求。感觉每解决一个问题和学会一种新的算法都会有着不同的成就感,自己也在享受这种感觉。遇到一个自己喜欢的事情,即便再累也会坚持下去,没...

2018-10-07 23:51:38 249

原创 网址集合

各大oj题目分类集合http://www.pythontip.com/acm/problemCategory杭电内部算法分类http://acm.hdu.edu.cn/typeclass.php大佬博客网址http://www.wutianqi.com/?page_id=2http://www.bycore.net/?author=0https://my.csdn.ne...

2018-08-05 21:18:36 1203

原创 2019/9/16网络赛总结

从8月23开的CCPC的网络赛到昨天结束ICPC最后一站网络赛,差不多一共是7场比赛。我们队伍的比赛配置是,开始每人一道题目,然后当一个人出思路后,另两个中的一个人帮助解答,另一个继续读题,就是两人作答,一人思路,这种配合让我们把不应该出现的错误降到了最低,也让加深了我们三个人的配合比赛中我负责的是计算几何,博弈以及模拟的解决,基本简单,中等的题目都差不多可以解决,但是一旦和其它算法结合处...

2019-09-16 20:20:43 204

原创 hdu 1154& Poj2462 Cutting a Polygon 计算几何模板集合

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1154用到了直线与线段的关系,直线与线段的交点,点是否在多边形内部,点是否在线段上等的模板 Cutting a Polygon Time Limit:1000MS Memory Limit:65536K Total Submissio...

2019-08-28 17:17:11 234

原创 线段,射线,直线的关系

二维坐标系#include<bits/stdc++.h>using namespace std;#define LL long long#define EPS 1e-8struct Point//二维坐标点{ double x; double y; Point(){} Point(double x,double y):x(x),y(y)...

2019-08-27 17:16:50 1659

原创 Out-out-control cars 计算几何(射线与线段相交判定)

题目链接:https://nanti.jisuanke.com/t/A1248DescriptionTwo out-of-control cars crashed within about a half-hour Wednesday afternoon on DeerPark Avenue. This accident alarmed the district governme...

2019-08-27 11:12:23 1247

原创 2019/8/23 第一场网络赛 总结

时间:2019/8/23 12:00 -- 17:00结果:一道题目没有今天没有按照教练的意思自己队伍做自己的,而是整个实验室一起做的,因为签到题我们出的比较慢,就没有再看签到题,然后每支队伍选道题目开始做,我们选的题目开始题意读错后来又MLE,TLE,最后也没有做出题来,今天是0A的一天缺失:读题不仔细,没有抓住关键点,忽略了好几个重要的细节,导致签到题细节出错,出现罚时,出题慢...

2019-08-23 22:25:51 120

原创 最小球覆盖 (退火算法)

#include<algorithm>#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<iostream>#include<iomanip>#include<list>#include&l...

2019-08-20 12:08:14 331

原创 暴力求规律+高斯消元找系数+小数转分数+逆元 解决规律题

例题:2018icpc南京现场赛-G Pyramid题目链接:http://codeforces.com/gym/101981/attachments或者:https://nanti.jisuanke.com/t/A2144暴力找规律#include<algorithm>#include<cstdio>#include<cstring>...

2019-08-20 11:55:33 328 2

原创 51nod 1635 第K个幸运排列 逆康托展开+DFS

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=1635康托展开和逆康托展开解释:https://blog.csdn.net/u011815404/article/details/994129891635 第K个幸运排列比得喜欢幸运数字。这里所说的幸运数字是由4和7组成的正整数。比如,整数47,744,4是...

2019-08-15 19:37:34 171

原创 Codeforces Round #152 (Div. 2) C. Robo-Footballer (二维几何)

题目链接:http://codeforces.com/problemset/problem/248/CC. Robo-FootballerIt's a beautiful April day and Wallace is playing football with his friends. But his friends do not know that Wallace actua...

2019-08-10 17:10:54 179

原创 2019/8/3 暑假集训总结

暑假第一篇总结,之前都是写的题解。。。。。。昨天给我印象最深的就是题目一定要仔细读题,而且要把所有的题干都读一编,说不定最后一句话就能把整道题的难度从AK题变到了签到题目(昨晚的D题,从1e18一下变到了1e5,最后十五分钟才看到,20是分钟过题,还是没有时间了)仔细读题,要把每一道题目都读一遍,加大胆尝试...

2019-08-03 08:55:45 241

原创 Codeforces Round #145 (Div. 1) D. Merging Two Decks

题目链接:http://codeforces.com/problemset/problem/240/DD. Merging Two Decksinput input.txtoutput output.txtThere are two decks of cards lying on the table in front of you, some cards in these d...

2019-08-01 11:03:26 129

原创 数据库

这里写自定义目录标题新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入 ...

2019-08-01 09:45:17 130

原创 Codeforces Round #145 (Div. 1) C. Practice

题目链接:http://codeforces.com/problemset/problem/240/CC. Practiceinput input.txtoutput output.txtLittle time is left before Berland annual football championship. Therefore the coach of team "Lo...

2019-08-01 09:25:57 156

原创 Codeforces Round #145 (Div. 2) D. Cinema

题目链接:http://codeforces.com/problemset/problem/234/DD. Cinemainput input.txtoutput output.txtOverall there aremactors in Berland. Each actor has a personal identifier — an integer from1to...

2019-07-31 09:52:33 139

原创 Codeforces Round #145 (Div. 2) C. Weather

题目链接:http://codeforces.com/problemset/problem/234/CC. Weatherinput input.txtoutput output.txtScientists say a lot about the problems of global warming and cooling of the Earth. Indeed, s...

2019-07-31 09:34:30 116

原创 51 nod 1242 斐波那契数列的第N项(矩阵快速幂的模板)

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=12421242 斐波那契数列的第N项斐波那契数列的定义如下:F(0) = 0F(1) = 1F(n) = F(n - 1) + F(n - 2) (n >= 2)(1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...

2019-07-31 09:23:15 164

原创 Codeforces Round #140 (Div. 1) C. Anniversary (两个定理的应用(数论+矩阵快速幂)

题目链接:http://codeforces.com/problemset/problem/226/CC. AnniversaryThere are less than 60 years left till the 900-th birthday anniversary of a famous Italian mathematician Leonardo Fibonacci. O...

2019-07-30 19:00:55 149

原创 51nod 1256 乘法逆元

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=12561256 乘法逆元给出2个数M和N(M < N),且M与N互质,找出一个数K满足0 < K < N且K * M % N = 1,如果有多个满足条件的,输出最小的。收起输入输入2个数M, N中间用空格分隔(1 <= M ...

2019-07-30 17:35:54 152

原创 51 nod 1298 圆与三角形

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=1298&judgeId=7712021298 圆与三角形给出圆的圆心和半径,以及三角形的三个顶点,问圆同三角形是否相交。相交输出"Yes",否则输出"No"。(三角形的面积大于0)。 ...

2019-07-29 17:06:22 171

原创 1130 N的阶乘的长度 V2(斯特林近似)

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=11301130 N的阶乘的长度 V2(斯特林近似)输入N求N的阶乘的10进制表示的长度。例如6! = 720,长度为3。收起输入第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 1000)第2 - T + 1行:...

2019-07-28 11:29:55 106

原创 51nod 1186 质数检测 V2 质数检测(四种方式)

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=11861186 质数检测 V2给出1个正整数N,检测N是否为质数。如果是,输出"Yes",否则输出"No"。收起输入输入一个数N(2 <= N <= 10^30)输出如果N为质数,输出"Yes",否则输出"No"。输入样例...

2019-07-28 10:51:30 238

原创 51nod 1058 N的阶乘的长度

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=10581058 N的阶乘的长度输入N求N的阶乘的10进制表示的长度。例如6! = 720,长度为3。收起输入输入N(1 <= N <= 10^6)输出输出N的阶乘的长度输入样例6输出样例3思路:n...

2019-07-27 17:21:07 110

原创 51nod 1006 最长公共子序列Lcs(输出任意公共子序列)模板

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=10061006 最长公共子序列Lcs给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。比如两个串为:abcicbaabdkscabab是两个串的子序列,abc也是,abca也是,其中abca是这两个字符串最长的子序列。收起...

2019-07-27 16:06:48 124

原创 51nod 1352 集合计数(扩展欧几里得的应用)

题目链接:http://www.51nod.com/Challenge/Problem.html#problemId=13521352 集合计数给出N个固定集合{1,N},{2,N-1},{3,N-2},...,{N-1,2},{N,1}.求出有多少个集合满足:第一个元素是A的倍数且第二个元素是B的倍数。提示:对于第二组测试数据,集合分别是:{1,10},{2,9},{3,8...

2019-07-27 11:25:25 156

原创 Codeforces Round #136 (Div. 1) C. Little Elephant and Shifts

题目链接:http://codeforces.com/problemset/problem/220/CC. Little Elephant and ShiftsThe Little Elephant has two permutationsaandbof lengthn, consisting of numbers from 1 ton, inclusive. Let...

2019-07-27 08:36:53 182

原创 poj1484 Fibonacci again and again SG模板

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1848Fibonacci again and againTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13653Acc...

2019-07-26 18:43:02 88

原创 Codeforces Round #140 (Div. 1) B. Naughty Stone Piles

题目链接:http://codeforces.com/problemset/problem/226/BB. Naughty Stone PilesThere arenpiles of stones of sizesa1, a2, ..., anlying on the table in front of you.During one move you can take one...

2019-07-26 16:43:11 140

原创 Codeforces Round #140 (Div. 1) D. The table 无限暴力

题目链接:http://codeforces.com/problemset/problem/226/DD. The tableHarry Potter has a difficult homework. Given a rectangular table, consisting ofn × mcells. Each cell of the table contains the in...

2019-07-26 10:05:02 179

原创 Codeforces Round #138 (Div. 1)B. Two Strings

题目链接:codeforces.com/problemset/problem/223/BB. Two StringsA subsequence of length |x| of string s = s1s2... s|s| (where |s| is the length of string s) is a string x = sk1sk2... sk|x| (1 ≤ k1 &lt...

2019-07-25 21:02:42 204

原创 Codeforces Round #138 (Div. 1) A. Bracket Sequence

题目链接:http://codeforces.com/problemset/problem/223/AA. Bracket SequenceAbracket sequenceis a string, containing only characters "(", ")", "[" and "]".Acorrect bracket sequenceis a bracket ...

2019-07-25 20:19:36 130

原创 Codeforces Round #138 (Div. 1)C. Partial Sums

C. Partial Sumstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got an arraya, consisting ofnintegers. The array eleme...

2019-07-25 18:51:07 135

原创 特殊三角矩阵的矩阵快速幂

构造出的矩阵:A1...A1 A2...A1 A2 A3...A1 A2 A3 .........An辅助矩阵:1 2 3......n0 1 2......n-10 0 1......n-20 0 0......1矩阵式对称的可以只保留(A1,A2.......An)和(1,2,3,....n)进行优化,这样矩阵运算的时候只需要两重循环#defin...

2019-07-25 16:54:39 1394

原创 Codeforces Round #575 (Div. 3)D. RGB Substring (hard version)

题目链接:http://codeforces.com/contest/1196/problem/D2D2. RGB Substring (hard version)The only difference between easy and hard versions is the size of the input.You are given a stringssconsist...

2019-07-25 15:30:02 123

原创 Codeforces Round #575 (Div. 3) E - Connected Component on a Chessboard

题目链接:http://codeforces.com/problemset/problem/223/CE. Connected Component on a ChessboardYou are given two integersbbandww. You have a chessboard of size109×109109×109with the top left cel...

2019-07-25 14:56:44 331

原创 SG定理和SG函数

在介绍SG函数和SG定理之前我们先介绍介绍必胜点与必败点吧.必胜点和必败点的概念: P点:必败点,换而言之,就是谁处于此位置,则在双方操作正确的情况下必败。 N点:必胜点,处于此情况下,双方操作均正确的情况下必胜。必胜点和必败点的性质:1、所有终结点是 必败点 P 。(我们以此为基本前提进行推理,换句话说,我们以此为假设)...

2019-07-24 15:36:45 117

原创 博弈论及算法实现(三种基础博弈)

一、巴什博弈(Bash Game)只有一堆n个物品,两个人从轮流中取出(1~m)个;最后取光者胜。考虑到 若n=m+1 那么 第一个人不论如何取都不能取胜。进一步我们发现 若 n=k*(m+1)+r; 先取者拿走 r 个,那么后者再拿(1~m)个n=(k-1)*(m+1)+s; 先取者再拿走s 个 最后总能造成 剩下n=m+1 的局面...

2019-07-24 09:21:39 7526 1

原创 连续非负整数的异或和

记f(x, y)为x到y的所有整数的异或值。 f(1,n) = f(0,n); 当n为2^k-1(2的K次方减一)时; 0 到 2^k-1 共2^k个数 等于∑C(n,i) 可以看做在k个位置中放入i个0,最后求和 同时可以看做在空格位置中放入i个1;最后求和 即在每一位上1个0的个数都相等,每个位上有2^(k-1)个1,当k>=2时 1的个数...

2019-07-23 16:44:50 365

原创 CodeForces 217 B Blackboard Fibonacci +暴力

题目链接:http://codeforces.com/contest/217/problem/BB. Blackboard Fibonaccitime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFibo...

2019-07-23 10:31:21 166

ACM算法整理-2018-12-21

自己整理的一点点比赛基础算法知识,互相学习,共同进步!有错误,请指正。

2018-12-21

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除