http://poj.org/problem?id=3032
提交的时候正赶上系统故障,全是Runtime Error!!!
一看Online Status,原来全是RT,POJ出故障了!!!!
Card Trick
Time Limit:1000MS |
|
Memory Limit:65536K |
|
|
|
Description
The magician shuffles a small pack of cards, holds it face down and performs the following procedure:
- The top card is moved to the bottom of the pack. The new top card is dealt face up onto the table. It is the Ace of Spades.
- Two cards are moved one at a time from the top to the bottom. The next card is dealt face up onto the table. It is the Two of Spades.
- Three cards are moved one at a time…
- This goes on until thenth and last card turns out to be thenof Spades.
This impressive trick works if the magician knows how to arrange the cards beforehand (and knows how to give a false shuffle). Your program has to determine the initial order of the cards for a given number of cards, 1 ≤ n ≤ 13.
Input
On the first line of the input is a single positive integer, telling the number of test cases to follow. Each case consists of one line containing the integern.
Output
For each test case, output a line with the correct permutation of the values 1 ton, space separated. The first number showing the top card of the pack, etc…
Sample Input
2
4
5
Sample Output
2 1 4 3
3 1 4 5 2
分享到:
相关推荐
模拟题 要注意时间的处理 使用优先队列处理请求的事件 进行适当的运算符重载,可以简化代码
北大POJ初级-简单搜索 解题报告+AC代码
如果有了这个的话,学习起来更系统,更清爽!
poj1379 给予平面内一个点集; 使用模拟退火求出一个点使该点到上述点集内任意一点最短距离最长。
北大POJ3253-POJ3253-Fence Repair【STL优先队列】 解题报告+AC代码
POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类
POJ 1988 并查集。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题...
很多的POJ题目答案!1000~1008,1011~1014,1016,1017,1019,1028,1032,1045,1046,1047,1050,1061,1067,1068,1088,1102,1159,1163,1183,1207,1218,1226,1247,1256,1258,1298,1316,1323,...
poj2340,模拟题,使用两个优先队列模拟即可。
博客链接 http://blog.csdn.net/CABI_ZGX/article/details/52701138
POJ第1861题源码 POJ第1861题源码 POJ第1861题源码
用python从poj网上趴下来的poj题目
poj分类poj分类poj分类poj分类
北大POJ1159-Palindrome 解题报告+AC代码
poj 3414解题报告poj 3414解题报告poj 3414解题报告poj 3414解题报告
poj 1012解题报告poj 1012解题报告poj 1012解题报告poj 1012解题报告
poj 2329解题报告poj 2329解题报告poj 2329解题报告poj 2329解题报告
poj 1659解题报告poj 1659解题报告poj 1659解题报告poj 1659解题报告