繁华模拟赛 ljw搭积木
2024-10-18 09:49:26
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn = ;
int n,x[maxn];
int cmd,cnt,ans,max_x;
int main(){
freopen("box.in","r",stdin);
freopen("box.out","w",stdout);
ios::sync_with_stdio(false);
cin>>n;
for(int i = ;i <= n;i++){
cin>>cmd;
x[cmd]++;
max_x = max(max_x,cmd);
}
while(){
cnt = ;
for(int i = ;i <= max_x;i++){
while(x[i] && i >= cnt){
x[i]--;
cnt++;
}
}
if(!cnt) break;
ans += ;
}
cout<<ans;
return ;
}
最新文章
- Node.js 教程 06 - 函数
- 讲座:Influence maximization on big social graph
- 初始Python
- 短链(ShortURL)的Java实现
- elixir 高可用系列 - 目录
- C#常用的加密算法
- MongoDB (十一) MongoDB 排序文档
- What does the number on the visual studio solution icon represent?
- php 操作xml文件
- IOS的处理touch事件处理(按照手指的移动移动一个圆,开发环境用的ios7,storyboard)
- mysql5.5升级到5.7
- ASP.NET MVC下使用AngularJs语言(五):ng-selected
- gnu screen的用法
- python使用requests时报错requests.exceptions.SSLError: HTTPSConnectionPool
- ubuntu 14.04 添加、删除用户,修改用户名称,修改主机名
- MyEclipse WebSphere开发教程:WebSphere 7安装指南(一)
- eterm和easyfare的官网地址
- C++静态成员的应用
- PreEssentials与MFC集成使用
- HDU 1104 Remainder(BFS 同余定理)