摘要: 描述 It is an interesting exercise to write a program to print out all permutations of 1, 2, …, n. However, since there are 6227020800 permutations of 1, 2, …, 13, it is unlikely that we would ever run this program on an input of size more than 10.However, here is another interesting problem whose sol 阅读全文
posted @ 2014-02-14 16:43 chen2013 阅读(225) 评论(0) 推荐(0)
摘要: 描述 A palindrome is a number that reads the same whether you read it from left to right or from right to left. Here is a surprising fact. Suppose we start with a number n. We reverse the digits of n and add it to n. If this number is a palindrome we stop. Otherwise, we repeat the reversal and additio 阅读全文
posted @ 2014-02-14 16:36 chen2013 阅读(350) 评论(0) 推荐(0)
摘要: 描述Given a string of symbols, it’s natural to look it over and see what substrings are present. In this problem, you are given a string and asked to consider what substrings are absent. Of course, a given string has finite length and therefore only finitely many substrings, so there are always infini 阅读全文
posted @ 2014-02-12 15:37 chen2013 阅读(266) 评论(0) 推荐(0)
摘要: 描述How can millions of different and complex structures be built using only a few simple building blocks? Just ask your DNA. DNA (short for deoxyribonucleic acid) spells out the genetic codes of millions of species, using just four molecules: adenine (A), guanine (G), thymine (T), and cytosine (C). T 阅读全文
posted @ 2014-02-12 13:26 chen2013 阅读(252) 评论(0) 推荐(0)
摘要: 描述Fractions in octal (base 8) notation can be expressed exactly in decimal notation. For example, 0.75 in octal is 0.953125 (7/8 + 5/64) in decimal. All octal numbers of n digits to the right of the octal point can be expressed in no more than 3n decimal digits to the right of the decimal point. Wri 阅读全文
posted @ 2014-02-11 16:09 chen2013 阅读(251) 评论(0) 推荐(0)
摘要: 描述 Once,in a kingdom,there are N cities.M roads have been buit such that from one city you can reach any other cities.Between any two cities there is ... 阅读全文
posted @ 2014-02-11 15:10 chen2013 阅读(255) 评论(0) 推荐(0)
摘要: 描述小Q被邪恶的大魔王困在了迷宫里,love8909决定去解救她。迷宫里面有一些陷阱,一旦走到陷阱里,就会被困身亡:(,迷宫里还有一些古老的传送阵,一旦走到传送阵上,会强制被传送到传送阵的另一头。现在请你帮助love8909算一算,他至少需要走多少步才能解救到小Q? (上下左右四个方向走,传送门可以多次使用)输入第一行为一个整数T,表示测试数据组数。每组测试数据第一行为两个整数N,M,(1 #include #include #include #define MAXN 55using namespace std;int T,M,N;int csMap[27][5];char m[MAXN][M 阅读全文
posted @ 2014-02-11 14:30 chen2013 阅读(565) 评论(0) 推荐(0)
摘要: 描述Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star. Astronomers want to know the distribution of the levels of the 阅读全文
posted @ 2014-02-08 23:14 chen2013 阅读(197) 评论(0) 推荐(0)
摘要: 描述 Bob always plays game with Alice.Today,they are playing a game on a tree.Alice has m1 stones,Bob has m2 stones.At the beginning of the game,all the stones are placed on the nodes of a tree,except the root.Alice moves first and they turns moving the stones.On each turn,the player chooses exactly o 阅读全文
posted @ 2014-02-08 18:05 chen2013 阅读(194) 评论(0) 推荐(0)
摘要: 描述I think most of you are using system named of xp or vista or win7.And these system is consist of a famous game what is mine sweeping.You must have p... 阅读全文
posted @ 2014-02-07 16:49 chen2013 阅读(331) 评论(0) 推荐(0)