编程介的小学生 2017-03-10 09:46 采纳率: 20.5%
浏览 795
已采纳

Let’s Hit Our Head!

问题描述 :

Kingdom LHOH is celebrating its annual carnival again!This time another crazy game is now on show.N*N piles of brick here lying on the ground in a straight line, and N brave fellows have attended.
First they should each choose a distinct piles brick to stand behind, forming a line parrelling to the brick, and facing the same side, watching at his piles of brick.
Then their captain can yelled out 3 commands, described below:
A "LEFT!" Every one should move so that he is behind the left piles of the original one.

B "RIGHT!" Every one should move so that he is behind the right piles of the original one.

C "HIT!" Every one should break all the piles of brick before him with only his head slamming them.

A little constraints are showed below:
In every step, when command A or B have been yelled out, no one should move outside, that is, for everyone after his moving, brick(even breaked up) is there before him,and when command C is to be yelled out, intact piles of brick must be there before every one, so that he cannot slamming brick that it already breaked up, and only that is fair to everyone.
Not until all piles of brick have been successfully breaked up with the brave fellows’ heads, this game is successfully finished.
Now the question is,the crazy captain wants to know how many initial options are there,satisfying for each initial option he always chooses the first piles, other members choose their own distinct ones,and the game can be finished successfully at the same time?
We assume the other members except the captain cannot be told out.

输入:

First there’s an integer T(T<=15000) indicating the scenary numbers.
Then there’s T lines represented for the scenaries, with an integer N(1<=N<=10^12) in each line.
输出:

First there’s an integer T(T<=15000) indicating the scenary numbers.
Then there’s T lines represented for the scenaries, with an integer N(1<=N<=10^12) in each line.
样例输入:

10
1
2
3
4
8
16
6469693228
6469693229
6469693230
1024
样例输出:

1
2
2
6
20
70
84
14
8787513806478134
184756

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-03-10 09:43
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?