CF234G.Practice
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Little time is left before Berland annual football championship. Therefore the coach of team "Losewille Rangers" decided to resume the practice, that were indefinitely interrupted for uncertain reasons. Overall there are n players in "Losewille Rangers". Each player on the team has a number — a unique integer from 1 to n. To prepare for the championship, the coach Mr. Floppe decided to spend some number of practices.
Mr. Floppe spent some long nights of his holiday planning how to conduct the practices. He came to a very complex practice system. Each practice consists of one game, all n players of the team take part in the game. The players are sorted into two teams in some way. In this case, the teams may have different numbers of players, but each team must have at least one player.
The coach wants to be sure that after the series of the practice sessions each pair of players had at least one practice, when they played in different teams. As the players' energy is limited, the coach wants to achieve the goal in the least number of practices.
Help him to schedule the practices.
距离贝尔兰年度足球锦标赛开幕的时间所剩无几。因此,“洛斯维尔流浪者队”的教练决定重启训练——此前该训练因不明原因被无限期中断。目前,“洛斯维尔流浪者队”共有 n 名球员,每名球员拥有一个唯一的编号,为从 1 到 n 的整数。为备战锦标赛,教练弗洛普先生决定安排若干次训练。
弗洛普先生利用假期中漫长的夜晚精心规划了训练方案,最终设计出一套极为复杂的训练体系。每次训练包含一场比赛,全队 n 名球员均须参加。比赛中,球员被划分为两支队伍(划分方式任意);这两支队伍的人数可以不同,但每支队伍至少需包含一名球员。
教练希望确保:在全部训练结束后,任意两名球员都至少曾在某一次训练中被分在不同的队伍里。由于球员体能有限,教练希望以最少的训练次数达成这一目标。
请你帮助他制定训练计划。
输入格式
A single input line contains integer n (2 ≤ n ≤ 1000).
单行输入包含一个整数 n(2≤n≤1000)。
输出格式
In the first line print m — the minimum number of practices the coach will have to schedule. Then print the descriptions of the practices in m lines.
In the i-th of those lines print f__i — the number of players in the first team during the i-th practice (1 ≤ f__i < n), and f__i numbers from 1 to n — the numbers of players in the first team. The rest of the players will play in the second team during this practice. Separate numbers on a line with spaces. Print the numbers of the players in any order. If there are multiple optimal solutions, print any of them.
第一行输出 m —— 教练需要安排的最少训练次数。随后在接下来的 m 行中输出各次训练的安排描述。
在这些行中的第 i 行,输出 fi —— 第 i 次训练中第一支队伍的球员人数(满足 1≤fi<n),以及 fi 个取值范围为 1 到 n 的整数 —— 第一支队伍中球员的编号。其余球员在本次训练中组成第二支队伍。同一行中的数字用空格分隔。球员编号的顺序可任意。若存在多种最优解,输出任意一种即可。
输入输出样例
输入#1
2
输出#1
1 1 1
输入#2
3
输出#2
2 2 1 2 1 1
输入解题思路,AI测评打分。不知道怎么写?