CF1854E.Game Bundles

NOI/NOI+/CTSC

通过率:0%

时间限制:3.00s

内存限制:512MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Rishi is developing games in the 2D metaverse and wants to offer game bundles to his customers. Each game has an associated enjoyment value. A game bundle consists of a subset of games whose total enjoyment value adds up to 6060.

Your task is to choose kk games, where 1≤k≤601 \leq k \leq 60, along with their respective enjoyment values a1,a2,…,aka_1, a_2, \dots, a_k, in such a way that exactly mm distinct game bundles can be formed.

里希正在二维元宇宙中开发游戏,并希望向顾客提供游戏捆绑包。每款游戏都有一个对应的愉悦值。一个游戏捆绑包由若干款游戏组成,其总愉悦值恰好为 6060。

你的任务是选择 kk 款游戏(其中 1≤k≤601 \leq k \leq 60)及其对应的愉悦值 a1,a2,…,aka_1, a_2, \dots, a_k,使得恰好能构成 mm 个互不相同的游戏捆绑包。

输入格式

The input is a single integer mm (1≤m≤10101 \le m \le 10^{10}) — the desired number of game bundles.

输入为一个整数 mm(1≤m≤10101 \le m \le 10^{10})——表示所需的游戏捆绑包数量。

输出格式

The first line should contain an integer kk (1≤k≤601 \le k \le 60) — the number of games.

The second line should contain kk integers, a1,a2,…,aka_1, a_2, \dots, a_k (1≤a1,a2,…,ak≤601 \le a_1, a_2, \dots, a_k \le 60) — the enjoyment values of the kk games.

第一行应包含一个整数 kk(1≤k≤601 \le k \le 60)—— 表示游戏的数量。

第二行应包含 kk 个整数 a1,a2,…,aka_1, a_2, \dots, a_k(1≤a1,a2,…,ak≤601 \le a_1, a_2, \dots, a_k \le 60)—— 表示这 kk 个游戏的愉悦值。

输入输出样例

  • 输入#1

    4

    输出#1

    4
    20 20 20 20
  • 输入#2

    722

    输出#2

    15
    15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
  • 输入#3

    1

    输出#3

    1
    60

说明/提示

In the first sample, any subset of size 33 is a game bundle. There are 44 such subsets.

在第一个样例中,任意大小为 33 的子集都是一个游戏包。这样的子集共有 44 个。

输入解题思路,AI测评打分。不知道怎么写?

首页