K.Selection

这是一道关于K.Selection的问题,LHR需要在每轮中选择不同的蔬菜鸟进行挑战。题目要求所有蔬菜鸟被挑战次数相同,且每轮组合不重复。给定蔬菜鸟的数量n,求LHR最多能进行多少轮。样例输入输出展示了当n为1和2时的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

K.Selection

签到题,直接交吧。

题目描述

There are nn vegetable-birds and LHR wants to kick their ass many times.

In each round, LHR can select several unique vegetable-birds and kick their ass.

To be fair, LHR should follow 22 principles:

At the end of all rounds, each vegetable-birds should be kicked the same number of times
The same vegetable-birds combination cannot appear in any two rounds
LHR wants to know how many rounds he can do at most, can you help him?

输入格式

The input only has an integer nn meaning the number of vegetable-birds.

1<=n<=50.

输出格式

Output an integer to indicate the maximum number of rounds that LHR can perform.

输入输出样例

输入 #1

1

输出 #1

1

输入 #2

2

输出 #2

3

说明/提示

In example 22, there are 22 vegetable-birds.
At round 11, LHR can kick the 1st vegetable-bird.
At round 22, LHR can kick the 2nd vegetable-bird.
At round 33, LHR can kick the 1st vegetable-bird and the 2nd vegetable-bird.

#include<bits/stdc++.h>

using namespace std; 
#define ll long long

int main()
{
	int n;
	cin>>n;
	ll m=pow(2,n)-1;//不要忘记开long long
	cout<<m<<endl;
	return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值