规律题
规律题
浪漫些许潦草
这个作者很懒,什么都没留下…
展开
-
hdu 小t的游戏(找规律)
小t的游戏Problem Description小t有点神经质,喜欢发明一些稀奇古怪的游戏,比如说左手和右手打架就是他发明的。这个周末,小t又发明了一个有趣的硬币游戏:小t手里有6枚硬币,他把硬币分成了两堆,一左一右并排堆放,一堆2个,一堆4个。然后他开始从这两个堆中各取出1个硬币,再组成一个新的堆放在最右边。用(2,4)表示初始两堆,于是作下抽象,第一次操作后(2,4原创 2017-02-27 21:47:41 · 437 阅读 · 0 评论 -
hdu 3032 Nim or not Nim? (SG函数+打表)
Nim or not Nim?Nim is a two-player mathematic game of strategy in which players take turns removing objects from distinct heaps. On each turn, a player must remove at least one object, and may remove a原创 2017-10-25 12:18:25 · 423 阅读 · 0 评论 -
hdu 6090 Rikka with Graph(找规律)
Rikka with Graph题目链接:Rikka with Graph题意:给你n个顶点,让你最多建m条边,如果顶点i和顶点j连通,则他们之间的权值为最短路上边的数量,否则他们之间的权值则为n求∑ni=1∑nj=1dist(i,j)\sum_{i=1}^{n}\sum_{j=1}^{n}dist(i,j)思路:只要想到把这张图建成这样的,直接找规律就行了 官方题解: 代码:#include<原创 2017-08-11 09:07:54 · 328 阅读 · 0 评论 -
hdu 6129 Just do it(递推)
Just do it题目链接:Just do it题意:有一个长度为nn的整数序列{an}\{{a}_{n}\},对其做mm次前缀异或和,求最终的序列。思路: 列举前几项数据 先看a,我们发现对于每一项,它的系数就是杨辉三角的值,那么如果当前位系数为奇数的话,就会对结果有贡献。对于杨辉三角,第x次变换第y项是C(x+y-2,y-1); C(n,m),如果n&m==m则C(n,m)为奇数,考虑原创 2017-08-16 17:24:55 · 603 阅读 · 0 评论 -
nyoj LYQの字符串(尺取法)
LYQの字符串题目描述 一个字符串如果其所有长度为奇数的子串都是回文串那么就称这个字符串是奇回文串。给你一个长度为N的字符串,假如让你最多可以修改k个字符,你的目标是求出最长的奇回文子串。がんばって输入 第一行一个正整数K,如上所述。第二行是一个字符串S。1≤K≤N≤106。S只包含小写字母。输出 输出奇回文字串的最大长度。 样例输入 3 abbc 1 ab 1 abcdef原创 2017-07-31 17:51:00 · 627 阅读 · 0 评论 -
hihocoder 1151 : 骨牌覆盖问题·二(找规律+矩阵快速幂)
骨牌覆盖问题·二描述上一周我们研究了2xN的骨牌问题,这一周我们不妨加大一下难度,研究一下3xN的骨牌问题? 所以我们的题目是:对于3xN的棋盘,使用1x2的骨牌去覆盖一共有多少种不同的覆盖方法呢? 首先我们可以肯定,奇数长度一定是没有办法覆盖的;对于偶数长度,比如2,4,我们有下面几种覆盖方式: 提示:3xN骨牌覆盖输入第1行:1个整数N。表示棋盘长度。1≤N≤100,000,000输出第1原创 2017-07-12 16:55:21 · 737 阅读 · 0 评论 -
CodeForces - 668B Little Artem and Dance(规律题)
Little Artem and DanceLittle Artem is fond of dancing. Most of all dances Artem likes rueda — Cuban dance that is danced by pairs of boys and girls forming a circle and dancing together.More detailed,原创 2017-05-04 19:06:30 · 643 阅读 · 0 评论 -
ZOJ 2316 Matrix Multiplication(找规律)(矩阵和它的转置矩阵之积)
Matrix MultiplicationLet us consider undirected graph G = which has N vertices and M edges. Incidence matrix of this graph is N * M matrix A = {aij}, such that aij is 1 if i-th vertex is one of the end原创 2017-04-18 21:59:24 · 890 阅读 · 0 评论 -
hdu 4722 Good Numbers(找规律)
Good NumbersProblem DescriptionIf we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number.You are required to count the numbe原创 2017-03-17 07:48:32 · 653 阅读 · 0 评论 -
NBUT 1225 NEW RDSP MODE I(找规律)(快速幂)
NEW RDSP MODE I问题描述Little A has became fascinated with the game Dota recently, but he is not a good player. In all the modes, the rdsp Mode is popular on online, in this mode, little A always loses gam原创 2017-04-10 19:33:47 · 487 阅读 · 0 评论 -
FZU 1062 洗牌问题(打表找规律)
洗牌问题Problem Description设2n张牌分别标记为1, 2, …, n, n+1, …, 2n,初始时这2n张牌按其标号从小到大排列。经一次洗牌后,原来的排列顺序变成n+1, 1, n+2, 2, …, 2n, n。即前n张牌被放到偶数位置2, 4, …, 2n,而后n张牌被放到奇数位置1, 3, …, 2n-1。可以证明对于任何一个自然数n,经过若干次洗牌后可恢复初始状态。现在你的原创 2017-03-24 07:36:14 · 668 阅读 · 0 评论 -
CodeForces - 376C Divisible by Seven(数论:同余定理)(找规律)
Divisible by SevenYou have number a, whose decimal representation quite luckily contains digits 1, 6, 8, 9. Rearrange the digits in its decimal representation so that the resulti原创 2017-03-12 21:38:16 · 608 阅读 · 0 评论 -
CodeForces - 633B A Trivial Problem(找规律)
A Trivial ProblemMr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of positive integers n, such原创 2017-03-12 08:31:22 · 599 阅读 · 0 评论 -
hdu 1030 Delta-wave(找规律)
Delta-waveProblem Description A triangle field is numbered with successive integers in the way shown on the picture below. The traveller needs to go from the cell with number M to the cell with number原创 2017-03-12 08:18:42 · 581 阅读 · 1 评论 -
hdu 3389 Game(博弈——找规律)
GameBob and Alice are playing a new game. There are n boxes which have been numbered from 1 to n. Each box is either empty or contains several cards. Bob and Alice move the cards in turn. In each turn原创 2017-10-25 23:01:47 · 780 阅读 · 0 评论