码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 5334 Virtual Participation(2015多校第四场)

时间:2015-07-31 16:09:47      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:

 
Problem Description
 
As we know, Rikka is poor at math. Yuta is worrying about this situation, so he asks rikka to
have some practice on codeforces. Then she opens the problem B:

Given an integer K, she needs to come up with an sequence of integers A satisfying that the
number of different continuous subsequence of A is equal to k.

Two continuous subsequences a, b are different if and only if one of the following conditions
is satisfied:

1. The length of a is not equal to the length of b.

2. There is at least one t that atbt, where at means the t-th element of a and bt means the t-th element of b.

Unfortunately, it is too difficult for Rikka. Can you help her?
 
Input
 
There are at most 20 testcases,each testcase only contains a single integer K (1K109)
 
Output
 
For each testcase print two lines.

The first line contains one integers n (nmin(K,105)).

The second line contains n space-separated integer Ai (1Ain) - the sequence you find.
 
Sample Input
 
10
 
Sample Output
 
4 1 2 3 4

HDU 5334 Virtual Participation(2015多校第四场)

标签:

原文地址:http://www.cnblogs.com/hgfblog/p/4692411.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!