You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl ...
分类:
其他好文 时间:
2017-03-07 08:40:20
阅读次数:
155
A - Dasha and Stairs(water) 题意:能否找到一个区间内奇数偶数个数分别为a和b。被hack了一个0 0的数据点orz.... 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int INF = 0x3f3f ...
分类:
其他好文 时间:
2017-02-02 12:06:28
阅读次数:
260
A. Dasha and Stairs(数学) http://codeforces.com/problemset/problem/761/A 题意:已知有a个偶数b个奇数,判断这些数能不能组成连续正整数数列。 算法:直接判断abs(a-b)≦1即可。注意a和b同时为0的情况。 代码: B. Dash ...
分类:
其他好文 时间:
2017-02-02 02:33:18
阅读次数:
288
A. Dasha and Stairs 保证a,b不同时为0,而且a 和 b 的绝对值不超过1即可。(心态崩了的我强行写出一个暴力,枚举了所有的情况。) code: B. Dasha and friends 对于两个跑道,分别计算出每个片段的长度。固定第一个跑道的起点,枚举第二个跑道的起点,看两个跑 ...
分类:
其他好文 时间:
2017-02-01 10:32:19
阅读次数:
174
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you cli... ...
分类:
其他好文 时间:
2017-01-14 12:19:42
阅读次数:
164
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl ...
分类:
其他好文 时间:
2016-12-30 20:38:47
阅读次数:
176
这道题参考了这个网址: http://blog.csdn.net/u012490475/article/details/48845683 /* 首先考虑边界情况,当有1层时,有一种方法。 然后再看2层时,有1+1、和2+0,两种方法。 再看3层时,首先有两种选择:走一步或者走两步。 如果走两步,那后 ...
分类:
其他好文 时间:
2016-12-20 07:17:20
阅读次数:
136
http://acm.hdu.edu.cn/showproblem.php?pid=4315 题意:有n个人要往坐标为0的地方移动,他们分别有一个位置a[i],其中最靠近0的第k个人是king,移动的时候在后面的人不能越过前面的人,先把king送到0的人胜。 思路:阶梯博弈。把n个人两两配对,形成一 ...
分类:
其他好文 时间:
2016-12-18 18:02:54
阅读次数:
184
Description A straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up ...
分类:
其他好文 时间:
2016-11-28 14:40:00
阅读次数:
281
#70. Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many dis ...
分类:
其他好文 时间:
2016-11-20 19:08:27
阅读次数:
198