#include #include using namespace std; struct
BTNode { int v; // default positive Integer. BTNode *pLeft; BTNode *pRight;
BTNode(int x) : v(x), pLeft(...
分类:
其他好文 时间:
2014-07-22 23:00:54
阅读次数:
294
Permutation p is
an ordered set of integers p1,??p2,??...,??pn,
consisting of n distinct positive integers, each of them doesn't exceed n.
We'll denote the i-th element of permutation p as pi.
...
分类:
其他好文 时间:
2014-07-22 23:00:15
阅读次数:
312
Subtraction Game 1
Chef is playing a game on a sequence of N positive integers, say A1, A2, ... AN. The game is played as follows.
If all the numbers are equal, the game ends.Otherwise
Sele...
分类:
其他好文 时间:
2014-05-07 03:14:01
阅读次数:
280
Problem DescriptionThe expression N!, read as
"N factorial," denotes the product of the first N positive integers, where N is
nonnegative. So, for exa...
分类:
其他好文 时间:
2014-05-07 00:11:55
阅读次数:
353
For a given positive integer n, please find the smallest positive integer x that we can find an integer y such that y^2 = n +x^2.
Input
The first line is an integer T, which is the the...
分类:
其他好文 时间:
2014-05-06 19:21:10
阅读次数:
290
Problem Description
Given an positive integer A (1
For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.
Another example...
分类:
其他好文 时间:
2014-05-05 13:22:39
阅读次数:
394
Tomya is a girl. She loves Chef Ciel very much.
Tomya like a positive integer p, and now she wants to get a receipt of Ciel's restaurant whose total price is exactly p.
The current menus of Ciel's...
分类:
其他好文 时间:
2014-05-04 18:53:40
阅读次数:
317
本题就是测试读入数据的速度的。
如果有大量的数据读入,使用cin是很慢的。
那么使用scanf那么会快很多,但是如果数据量更大的话那么就还是不够快了。
所以这里使用fread。
首先开一个buffer,然后使用fread大块大块地读入数据就可以非常快地读入了。
题目如下:
Input
The input begins with two positive...
分类:
其他好文 时间:
2014-05-03 16:13:21
阅读次数:
340
Number Sequence
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 33215
Accepted: 9490
Description
A single positive integer i is given. Write a program to f...
分类:
其他好文 时间:
2014-05-01 22:06:17
阅读次数:
437
19. 二叉树的镜像(递归)即:交换所有节点的左右子树。从下往上 或 从上往下
都可以。#include #include using namespace std;struct BTNode{ int v; // default
positive Integer. BTNode *pLeft; B....
分类:
其他好文 时间:
2014-05-01 12:41:11
阅读次数:
416