Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However,...
分类:
其他好文 时间:
2015-03-06 11:24:03
阅读次数:
142
Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from
S1. Your task is simply to calculate S1 - S2 for any given strings. However,...
分类:
其他好文 时间:
2015-03-06 11:21:17
阅读次数:
140
读入一个自然数n,计算其各位数字之和,用汉语拼音写出和的每一位数字。 输入格式:每个测试输入包含1个测试用例,即给出自然数n的值。这里保证n小于10100。 输出格式:在一行内输出n的各位数字之和的每一位,拼音数字间有1 空格,但一行中最后一个拼音数字后没有空格。 输入样例:123456789098...
分类:
其他好文 时间:
2015-03-05 23:32:43
阅读次数:
170
#include#includeusing namespace std;const int AIM=6174;int n;int arr[4];bool NonIncreasingOrder(int a,int b){ return a>b;}bool NonDecreasingOrder(int....
分类:
其他好文 时间:
2015-03-05 20:59:09
阅读次数:
156
#include#includeusing namespace std;const int AIM=6174;int n;int arr[4];bool NonIncreasingOrder(int a,int b){ return a>b;}bool NonDecreasingOrder(int....
分类:
其他好文 时间:
2015-03-05 20:52:58
阅读次数:
215
卡拉兹(Callatz)猜想:对任何一个自然数n,如果它是偶数,那么把它砍掉一半;如果它是奇数,那么把(3n+1)砍掉一半。这样一直反复砍下去,最后一定在某一步得到n=1。卡拉兹在1950年的世界数学家大会上公布了这个猜想,传说当时耶鲁大学师生齐动员,拼命想证明这个貌似很傻很天真的命题,结果闹得学生...
分类:
其他好文 时间:
2015-03-05 19:22:15
阅读次数:
130
#includeint main(){ int n,ans=0,now=0; //要停n层,ans是总时间,now代表当前层数 scanf("%d",&n); for(int i=0 ; inow) //上楼,每上一层6秒 { ans+=(tmp...
分类:
其他好文 时间:
2015-03-05 19:03:54
阅读次数:
104
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:
The left subtree of a node contains only nodes with keys less than the node's key.
The righ...
分类:
其他好文 时间:
2015-03-05 17:08:50
阅读次数:
178
Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can be cut at any position ...
分类:
其他好文 时间:
2015-03-05 17:00:26
阅读次数:
144
Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate with gambler...
分类:
系统相关 时间:
2015-03-05 14:55:12
阅读次数:
197