Problem Description
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified ...
分类:
其他好文 时间:
2015-01-28 09:55:48
阅读次数:
148
Problem Description
有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。
其中,蜂房的结构如下所示。
Input
输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0
Output
对于每个测试实例,请输出蜜蜂从蜂房a爬到蜂房b的可能路线数,每个实例的输出占一行...
分类:
其他好文 时间:
2015-01-28 09:54:55
阅读次数:
97
Problem Description
An inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. During the rest, i...
分类:
其他好文 时间:
2015-01-28 09:52:39
阅读次数:
114
Problem Description
用N个三角形最多可以把平面分成几个区域?
Input
输入数据的第一行是一个正整数T(1
Output
对于每组测试数据,请输出题目中要求的结果.
Sample Input
2
1
2
Sample Output
2
8
代码如下:
#include
using namespace std;
long...
分类:
其他好文 时间:
2015-01-26 22:58:10
阅读次数:
273
Problem Description
The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and...
分类:
其他好文 时间:
2015-01-26 17:21:09
阅读次数:
137
Problem Description
A snail is at the bottom of a 6-foot well and wants to climb to the top. The snail can climb 3 feet while the sun is up, but slides down 1 foot at night while sleeping. The snai...
分类:
其他好文 时间:
2015-01-26 12:01:38
阅读次数:
165
1 #include "cstdio" 2 #include "iostream" 3 #include "cstring" 4 #include "vector" 5 #include "queue" 6 using namespace std; 7 8 #define MAXN 2222 9.....
分类:
其他好文 时间:
2015-01-25 22:26:43
阅读次数:
157
/*这里将fa[]数组初始化为-1比较方便 输入格式有点坑 看的讨论*/ 1 #include "cstdio" 2 #include "iostream" 3 #include "cstring" 4 #include "vector" 5 #include "queue" 6 #include ...
分类:
其他好文 时间:
2015-01-25 22:26:19
阅读次数:
140
题目要求是可达情况下,舒适度最好,即速度之差最小。1.因为不考虑距离 所以只要在同一集合中即可2.需要在条件1下枚举最小速度,然后找符合条件的 1 #include "iostream" 2 #include "algorithm" 3 #include "memory.h" 4 #include ...
分类:
其他好文 时间:
2015-01-25 18:05:42
阅读次数:
102
/*题目一大堆,其实意思就是长度为n个二进制数,里面有h个1,将这个二进制数进行全排列,然后输出*/#include"iostream"#include"algorithm"#include"stdio.h"#include"string.h"#include"cmath"#include"queu...
分类:
其他好文 时间:
2015-01-25 15:09:52
阅读次数:
156