1 import java.math.BigInteger; 2 import
java.util.*; 3 public class Main { 4 public static void main(String []args) 5 {
6 Scanner cin...
分类:
其他好文 时间:
2014-06-07 05:07:21
阅读次数:
222
行列的走法不互相影响,可以分开计算,最后再组合相乘累加即可 1 #include 2
#include 3 int c[1010][1010]; 4 int dpx[1010][1010],x[1010]; 5 int
dpy[1010][1010],y[1010]; 6 int n,m,k,x0,...
分类:
其他好文 时间:
2014-05-28 20:21:06
阅读次数:
287
You are given a string,S, and a list of
words,L, that are all of the same length. Find all starting indices of
substring(s) in S that is a concatenati...
分类:
其他好文 时间:
2014-05-28 04:03:54
阅读次数:
240
http://acm.hdu.edu.cn/showproblem.php?pid=1565
方格取数(1)Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K
(Java/Others) Total Submissi....
分类:
其他好文 时间:
2014-05-28 00:31:16
阅读次数:
248
http://acm.hdu.edu.cn/showproblem.php?pid=3367
1 #include 2 #include 3 #include 4 #define maxn 20000 5 using namespace std; 6 7
int n,m; 8 int f[m...
分类:
其他好文 时间:
2014-05-28 00:03:30
阅读次数:
451
题意:与原来基本的尼姆博弈不同的是,可以将一堆石子分成两堆石子也算一步操作,其它的都是一样的。分析:由于石子的堆数和每一堆石子的数量都很大,所以肯定不能用搜索去求sg函数,现在我们只能通过找规律的办法求得sg的规律。通过打表找规律可以得到如下规律:if(x%4==0)
sg[x]=x-1; if(x...
分类:
其他好文 时间:
2014-05-27 23:58:54
阅读次数:
354
http://acm.hdu.edu.cn/showproblem.php?pid=1063
1 import java.math.BigDecimal; 2 import java.util.*; 3 public class Main { 4
public static void mai...
分类:
其他好文 时间:
2014-05-27 23:57:40
阅读次数:
491
Scenic PopularityTime Limit: 2000/1000 MS
(Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s):
340Accepted Submission(s): 110Pro...
分类:
其他好文 时间:
2014-05-27 17:46:22
阅读次数:
308
A. Scenic
Popularityhttp://acm.hdu.edu.cn/showproblem.php?pid=4831思路:景点区会控制休息区的Hot值,我们建立休息区到它最近的景点区的关系,注意处理冲突。查询和修改都暴力进行,预处理关系,从左到右,然后从右到左遍历一遍即可,更新时候,...
分类:
其他好文 时间:
2014-05-27 16:50:43
阅读次数:
324
题目链接分析:打表以后就能发现时卡特兰数, 但是有除法取余。f[i] = f[i-1]*(4*i -
2)/(i+1);看了一下网上的题解,照着题解写了下面的代码,不过还是不明白,为什么用扩展gcd, 不是用逆元吗。。网上还有别人的解释,没看懂,贴一下:(a /
b) % m = ( a % (m*...
分类:
其他好文 时间:
2014-05-27 16:17:10
阅读次数:
305