1 条题解
-
0
#include <bits/stdc++.h> using namespace std; #define int long long int n,t,b[1010],ans,ma=-1; signed main(){ ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); cin>>n; for(int i=1;i<=n;i++){ cin>>t; b[t]++; ma=max(ma,t); } for(int i=0;i<=ma;i++){ while(b[i]>0){ ans++; t=0; for(int j=i;j<=ma;j++){ while(b[j]>0&&j>=t){ t++; b[j]--; } } } } cout<<ans; return 0; }
信息
- ID
- 2417
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 5
- 标签
- (无)
- 递交数
- 141
- 已通过
- 53
- 上传者