http://acm.hdu.edu.cn/showproblem.php?pid=4472第一个本能的找规律。第二直觉 树被分成的子树,然后,复发或DP然后发现不。然后,他们发现,他们并没有阅读题,。。,dp[i]=segma(dp[j] | (i-1)%j==0)#include #includ...
分类:
其他好文 时间:
2015-09-10 15:51:10
阅读次数:
125
Problem Description:A triangle field is numbered with successive integers in the way shown on the picture below.The traveller needs to go from the cel...
分类:
其他好文 时间:
2015-09-08 00:21:08
阅读次数:
147
C# 正则表达式篇 一、正则表达式 正则表达式就是一个字符串,不要想着一下子可以写出一个通用的表达式,先写,不正确再改 写正则表达式就是在找规律 关键字:Regex --》引入命名空间 System.Text 常用的方法 1、 匹配: --》Regex.IsMatch(要匹配的字符串,正则表达式);...
有n堆石子,alice先取,每次可以选择拿走一堆石子中的1~x(该堆石子总数) ,也可以选择将这堆石子分成任意的两堆。alice与bob轮流取,取走最后一个石子的人胜利。打表代码: 1 #include 2 #include 3 #include 4 #include 5 using namespa...
分类:
其他好文 时间:
2015-09-07 00:16:15
阅读次数:
229
Holding Bin-Laden Captive!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17653Accepted Submission...
分类:
其他好文 时间:
2015-09-04 18:32:19
阅读次数:
174
A. Hanoi towerTime Limit: 1 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100114Descriptionyou the conditions of this task. There are 3 pivots:...
分类:
其他好文 时间:
2015-09-03 19:14:44
阅读次数:
365
题目意思很简单。就是洗牌,抽出奇数和偶数,要么奇数放前面,要么偶数放前面。总共2^N张牌。需要问的是,给了A X B Y 问经过若干洗牌后,第A个位置是X,第B个位置是Y 是不是可能的。Jason is not only an ACMer, but also a poker nerd. He is ...
分类:
其他好文 时间:
2015-09-03 15:12:54
阅读次数:
290
先写一个完全背包,然后找规律,然后打表。#include#include#include#includeusing namespace std;int a[2000000 + 100];int Zhong[2000000 + 100];int tot;int MOD = 1000000;int ma...
分类:
其他好文 时间:
2015-09-02 21:56:47
阅读次数:
181
1.题目描述:点击打开链接
2.解题思路:本题利用dp解决。不过这个dp的思路的确比太容易想到。需要观察规律才能发现。我们可以从贡献值的角度考虑。以题目中给的样例来说明这种方法。
通过观察相邻两个w值,我们会发现一个事实:每个大区间都包含了小区间的解(这里的解即原题中的sum值)。但是这...
分类:
其他好文 时间:
2015-08-30 14:23:31
阅读次数:
153
Fibonacci Again
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 44697 Accepted Submission(s): 21341
Problem Description
There are ...
分类:
编程语言 时间:
2015-08-29 09:52:19
阅读次数:
134