<p>一个N位的十进制正整数,如果它的每个位上的数字的N次方的和等于这个数本身,则称其为花朵数。<br /> 例如:<br /> 当N=3时,153就满足条件,因为 1^3 + 5^3 + 3^3 = 153,这样的数字也被称为水仙花数(其中,&ldquo;^&rdquo;表示乘方,5^3表示5的3次方,也就是立方)。<br /> 当N=4时,1634满足条件,因为 1^4 + 6^4 + 3^4 + 4^4 = 1634。<br /> 当…

2020年1月17日 0条评论 1323点热度 0人点赞 code 阅读全文

<p><img align="right" alt="" src="http://plg1.cs.uwaterloo.ca/%7Eacm00/090613/B.png" /></p> <p>Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape pla…

2020年1月17日 0条评论 1278点热度 0人点赞 code 阅读全文

<p>Consider strings formed from characters from an alphabet of size <i>K</i>. For example, if <i>K = 4</i>, our alphabet might be <i>{a,b,c,d}</i>, and an example string is <i>bbcac</i>.</p> <p>…

2020年1月17日 0条评论 1688点热度 0人点赞 code 阅读全文

<img align="right" src="http://plg1.cs.uwaterloo.ca/%7Eacm00/090613/A.png" alt="" /> <p>The game of Tic Tac Toe is played on an</p> <i>n</i> <p>-by-</p> <i>n</i> <p>grid (where</p> <i>n<…

2020年1月17日 0条评论 1456点热度 0人点赞 code 阅读全文

<p>Dominos are lots of fun. Children like to stand the tiles on their side in long lines. When one domino falls, it knocks down the next one, which knocks down the one after that, all the way down the line. However, sometimes a domino fails to knock the …

2020年1月17日 0条评论 1292点热度 0人点赞 code 阅读全文

<p>Logo is a programming language built around a turtle. Commands in the language cause the turtle to move. The turtle has a pen attached to it. As the turtle moves, it draw lines on the page. The turtle can be programmed to draw interesting pictures.<…

2020年1月17日 0条评论 1624点热度 0人点赞 code 阅读全文