当前位置:网站首页>Codeforces Round #643 (Div. 2)——B. Young Explorers
Codeforces Round #643 (Div. 2)——B. Young Explorers
2022-07-08 01:41:00 【Not long】
Topic link :https://codeforces.com/problemset/problem/1355/B
Title Description : Enter the explorer's experience level , When forming a team, the number of people in a team cannot be less than the experience level of any person in the team ( The number of people is greater than the highest experience level in the team ), It is required to form the largest number of teams .
Their thinking : greedy Choose people with low experience level to form a team that meets the conditions first .—— First sort by experience level from low to high , When the conditions are met, form a team .
Code :
#include<iostream>
#include<algorithm>
using namespace std;
int num[200005];
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> num[i];
sort(num, num + n);
int ans = 0, count = 0;
for (int i = 0; i < n; i++)
{
count++;
if (count >= num[i])
{
ans++;
count = 0;
}
}
cout << ans << endl;
}
return 0;
}
边栏推荐
- QT--创建QT程序
- 滑环使用如何固定
- About how USRP sets the sampling frequency below the minimum sampling frequency reached by the hardware
- Anaconda3 tutorial on installing and adding Tsinghua image files
- 2、TD+Learning
- Understanding of maximum likelihood estimation
- 云原生应用开发之 gRPC 入门
- The Ministry of housing and urban rural development officially issued the technical standard for urban information model (CIM) basic platform, which will be implemented from June 1
- Working principle of stm32gpio port
- MATLAB R2021b 安装libsvm
猜你喜欢

2022 chemical automation control instrument examination summary and chemical automation control instrument simulation examination questions

nacos-微服务网关Gateway组件 +Swagger2接口生成
![Gnuradio operation error: error thread [thread per block [12]: < block OFDM_ cyclic_ prefixer(8)>]: Buffer too small](/img/ab/066923f1aa1e8dd8dcc572cb60a25d.jpg)
Gnuradio operation error: error thread [thread per block [12]: < block OFDM_ cyclic_ prefixer(8)>]: Buffer too small

2、TD+Learning

3. Multi agent reinforcement learning

2021 Shanghai safety officer C certificate examination registration and analysis of Shanghai safety officer C certificate search

5、離散控制與連續控制

为什么更新了 DNS 记录不生效?

2022 operation certificate examination for main principals of hazardous chemical business units and main principals of hazardous chemical business units

2022 high voltage electrician examination skills and high voltage electrician reexamination examination
随机推荐
城市土地利用分布数据/城市功能区划分布数据/城市poi感兴趣点/植被类型分布
2021-03-06 - play with the application of reflection in the framework
2022 refrigeration and air conditioning equipment operation examination questions and refrigeration and air conditioning equipment operation examination skills
2022 safety officer-b certificate examination question bank and safety officer-b certificate simulation test questions
不算不知道,花呗分期的真实利率居然这么高
The usage of rand function in MATLAB
Anaconda3 tutorial on installing and adding Tsinghua image files
用户之声 | 冬去春来,静待花开 ——浅谈GBase 8a学习感悟
common commands
ANSI / nema- mw- 1000-2020 magnetic iron wire standard Latest original
子矩阵的和
Voice of users | winter goes and spring comes, waiting for flowers to bloom -- on gbase 8A learning comprehension
About snake equation (5)
2、TD+Learning
云原生应用开发之 gRPC 入门
Introduction to grpc for cloud native application development
Urban land use distribution data / urban functional zoning distribution data / urban POI points of interest / vegetation type distribution
Gnuradio transmits video and displays it in real time using VLC
Codeforces Round #633 (Div. 2) B. Sorted Adjacent Differences
Redis cluster