Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 17} is 15. The...
分类:
其他好文 时间:
2015-03-03 13:43:53
阅读次数:
168
Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, "helloworld" can be printed as:
h d
e l
l r
lowo
That is, the characters must be pr...
分类:
其他好文 时间:
2015-03-03 13:37:59
阅读次数:
154
#include#includeusing namespace std;bool HARSH[10066]; //实际上申请来之后初试都是falsebool cmp(int a,int b){ return a>b;}int main(){ fill(HARSH,HARSH+1066,...
分类:
其他好文 时间:
2015-03-03 13:31:23
阅读次数:
171
People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 dig...
分类:
其他好文 时间:
2015-03-03 09:59:09
阅读次数:
150
#include#include#includeusing namespace std;bool HARSH[260]; //实际上申请来之后初试都是falseint main(){ fill(HARSH,HARSH+260,true); char str1[10066]; char...
分类:
其他好文 时间:
2015-03-02 23:44:22
阅读次数:
163
#include#includeint harsh[10066];int arr[100066];int main(){ memset(harsh,0,sizeof(harsh)); memset(arr,0,sizeof(arr)); int n; scanf("%d",&n); for...
分类:
编程语言 时间:
2015-03-02 22:24:09
阅读次数:
188
#include#includebool HARSH[256]={false}; //标记字符,初始化都未输出过int main(){ char str1[100],str2[100],tmp[100]; gets(str1); gets(str2); int len1=strle...
分类:
其他好文 时间:
2015-03-02 20:50:54
阅读次数:
183
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the cor...
分类:
其他好文 时间:
2015-03-02 19:10:38
阅读次数:
135
A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be assigned to the ava...
分类:
其他好文 时间:
2015-03-02 19:10:02
阅读次数:
126
Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number con...
分类:
其他好文 时间:
2015-03-02 19:09:06
阅读次数:
193