算法
Amon_cj
这个作者很懒,什么都没留下…
展开
-
贪心算法题型总结
挑选了几个不同的关于贪心算法的题,有按C写的也有后来补充的C++写的。题1 POJ - 2940题目描述解题思路代码解析题2 HDU - 1009题目描述解题思路代码解析题3 HDU - 2089题目描述解题思路代码解析题4 HDU - 2037题目描述解题思路代码解析题5 HDU - 5055题目描述解题思路代码解析题6 H...原创 2017-12-04 01:31:08 · 15918 阅读 · 0 评论 -
LightOJ 1401 No More Tic-tac-toe 博弈论SG打表
题目链接点这里No More Tic-tac-toeProblem DescriptionAlice was bored with the game tic-tac-toe. Usually she used to play against computer. She was so bored because, she always managed to make a tie against...原创 2018-11-12 21:22:35 · 15486 阅读 · 3 评论 -
LightOJ - 1344 Aladdin and the Game of Bracelets博弈论SG打表
题目链接点击这里原创 2018-11-13 08:08:50 · 15658 阅读 · 0 评论 -
模板题集合
[队列] priority_queue<int, vector<int>, greater<int> > q; // 从小到大[最长公共子序列]#include <iostream>#include <cstring>using namespace std;int a[原创 2018-07-28 14:00:37 · 17820 阅读 · 0 评论 -
同余模定理
原文地址:https://blog.csdn.net/qq_29600137/article/details/50821993同余模定理定义:• 所谓的同余,顾名思义,就是许多的数被一个数d去除,有相同的余数。d数学上的称谓为模。如a=6,b=1,d=5,则我们说a和b是模d同余的。因为他们都有相同的余数1。• 数学上的记法为:• a≡ b(mod d...转载 2018-05-14 17:47:40 · 18523 阅读 · 0 评论 -
HDU 1005 Number Sequence
HDU 1005 Number SequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 195570 Accepted Submission(s): 49019Problem DescriptionA numb...原创 2018-05-11 14:52:50 · 14798 阅读 · 0 评论 -
ACM:Ignatius and the Princess IV
Ignatius and the Princess IV“OK, you are not too bad, em… But you can never pass the next test.” feng5166 says. “I will tell you an odd number N, and then N integers. There will be a special integ...原创 2018-01-19 15:12:50 · 15656 阅读 · 1 评论 -
ACM: STL标准库容器的应用(vector、queue、list、map)
有碰到STL类型的题,就看了下关于STL的视频,粗略学习了下C++以及STL的用法… 以前从没用过C++也没看过和C++相关的知识,所以很多地方还是保持的C代码的风格..很多时候scanf和printf都改不过来… 但是用STL真的好方便啊…而且完全不会出错..用过以后再也不想写C了… 顺便再推荐一个网站http://www.cplusplus.com/reference/ 查询各种函数超...原创 2018-01-23 22:24:07 · 16705 阅读 · 1 评论 -
ACM:LCM Walk
A frog has just learned some number theory, and can’t wait to show his ability to his girlfriend. Now the frog is sitting on a grid map of infinite rows and columns. Rows are numbered 1,2,⋯ from the...原创 2018-01-22 10:53:36 · 15702 阅读 · 0 评论 -
ACM:素数线性筛法(素数打表)
通过一道题来讲一下素数筛法。 (我理解的素数筛法。。不一定对) 原题: https://vjudge.net/contest/205544#problem/H 题目在文章末尾。在此之前可以先看一篇博客,原文的地址不知道为啥打不开了..网上有很多转载的,以下是一个转载的地址: http://blog.csdn.net/net_assassin/article/details/89605...原创 2018-01-22 01:22:32 · 21351 阅读 · 0 评论 -
数位dp
原文地址:https://blog.csdn.net/brazy/article/details/77427699觉得写得很不错~~=============================数位dp是一种计数用的dp,一般就是要统计一个区间[le,ri]内满足一些条件数的个数。所谓数位dp,字面意思就是在数位上进行dp咯。数位还算是比较好听的名字,数位的含义:一个数有个位、十位、百位、千位...转载 2018-11-17 21:38:32 · 15126 阅读 · 0 评论