文件名称:TOMyishupin
介绍说明--下载内容均来自于网络,请自行研究使用
TOM设计了一件艺术品,该艺术品由N个构件堆叠而成,N个构件从高到低按层编号依次为1,2,…,N。艺术品展出后,引起强烈的反响。Tom观察到,人们尤其对作品的高端部分评价甚多。狂热的Tom一激动,对组成该艺术品的N个构件重新组合,比如:把第6层到第12层的构建搬下来,想一想,然后整体放到剩下构件的第7层下面;过一会儿,又把第2层到第9层的构件搬下来,整体放到剩下构件的第1层下面等等。于是,Tom在进行了连续若干次“搬来搬去”后,还是这N个构件又诞生了一件新的艺术品。
编程:请输出新的艺术品最高十层构件的编号。
[标准输出]
第一行: N K 表示构件的总数和“搬来搬去”的总次数
第2~K+1行: A B C 表示要搬动的构件(即从第A层到B层)整个放在第c层下面;如果C=0,则要搬动的构件将放到最高层。
[标准输出]
由十行组成,分别为组成新艺术品的第一层到第十层构件的编号。
[约束条件]
(1) 10≤N≤20000 1≤K≤100
(2) 1≤A≤B≤N 0≤C≤N-(B-A+1)-TOM design a piece of art, the works of art made by the N-component stack, N a component to low level code followed by 1,2, ..., N. Works of art on display, the cause strong repercussions. Tom observed that people, especially the works of many high-end part of the evaluation. Tom a feverish excitement on the composition of the N-component of the art re-combination, for example: the 6th floor to 12th floor of the building to move down, think about it, and then put the remaining components of the overall level below 7 over while, again Layer 2 to 9 layers of components to move down into the rest of the whole layer of the following components 1 and so on. So, Tom several times during a continuous "moving around" after, or the N-component and the birth of a new art
编程:请输出新的艺术品最高十层构件的编号。
[标准输出]
第一行: N K 表示构件的总数和“搬来搬去”的总次数
第2~K+1行: A B C 表示要搬动的构件(即从第A层到B层)整个放在第c层下面;如果C=0,则要搬动的构件将放到最高层。
[标准输出]
由十行组成,分别为组成新艺术品的第一层到第十层构件的编号。
[约束条件]
(1) 10≤N≤20000 1≤K≤100
(2) 1≤A≤B≤N 0≤C≤N-(B-A+1)-TOM design a piece of art, the works of art made by the N-component stack, N a component to low level code followed by 1,2, ..., N. Works of art on display, the cause strong repercussions. Tom observed that people, especially the works of many high-end part of the evaluation. Tom a feverish excitement on the composition of the N-component of the art re-combination, for example: the 6th floor to 12th floor of the building to move down, think about it, and then put the remaining components of the overall level below 7 over while, again Layer 2 to 9 layers of components to move down into the rest of the whole layer of the following components 1 and so on. So, Tom several times during a continuous "moving around" after, or the N-component and the birth of a new art
(系统自动生成,下载前可以参看下载内容)
下载文件列表
TOMyishupin.CPP