摘要: 问题:给定N个节点,能构成多少种不同的二叉树.回答:卡特兰数运用.import java.util.*;import java.math.*;public class Main{ public static void main(String[] args) { int n; Scanner in=... 阅读全文
posted @ 2015-06-03 12:20 chaoer 阅读(188) 评论(0) 推荐(0)
摘要: 问题:On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is playe... 阅读全文
posted @ 2015-06-02 08:38 chaoer 阅读(307) 评论(0) 推荐(0)
摘要: 问题:有N个小孩围成一圈,给他们从1开始依次编号,现指定从第W个开始报数,报到第S个时,该小孩出列,然后从下一个小孩开始报数,仍是报到S个出列,如此重复下去,直到所有的小孩都出列(总人数不足S个时将循环报数),求小孩出列的顺序。Input第一行输入小孩的人数N(N#include #include ... 阅读全文
posted @ 2015-06-01 09:53 chaoer 阅读(678) 评论(0) 推荐(0)
摘要: 问题:As an experienced ACMer, you must have known the importance of "code template library". With the help of pre-printed code library, you can implemen... 阅读全文
posted @ 2015-05-31 08:02 chaoer 阅读(586) 评论(0) 推荐(0)
摘要: 问题:In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all the 108 people in... 阅读全文
posted @ 2015-05-31 07:55 chaoer 阅读(171) 评论(0) 推荐(0)
摘要: 问题:给出一个数,计算出其全排列结果。回答:方法一:#include #include #include #define maxN 4using namespace std; int main(){ int p[maxN] = {-1}; for(int i=0; i#include //#def... 阅读全文
posted @ 2015-05-30 09:17 chaoer 阅读(272) 评论(0) 推荐(0)
摘要: 问题:Biologists finally invent techniques of repairing DNA that contains segments causing kinds of inherited diseases. For the sake of simplicity, a DNA... 阅读全文
posted @ 2015-05-29 10:44 chaoer 阅读(325) 评论(0) 推荐(0)
摘要: 问题:Candy and his friends found a treasure map. With the help of the map, they successfully found the treasure inside an ancient cave, but just as they... 阅读全文
posted @ 2015-05-28 08:33 chaoer 阅读(198) 评论(0) 推荐(0)
摘要: 问题:John is going on a fishing trip. He has h hours available (1 = 0 ), is known. Each 5 minutes of fishing decreases the number of fish expected to be... 阅读全文
posted @ 2015-05-27 14:33 chaoer 阅读(432) 评论(0) 推荐(0)
摘要: 问题:Input输入的第一行是一个整数T( 1 #include #include #include #includeusing namespace std;#define M 2005int a[M][26],b[26];vectorQ;void main(){ int T; scanf("%d"... 阅读全文
posted @ 2015-05-26 08:58 chaoer 阅读(283) 评论(0) 推荐(0)