@inkysakura
2017-09-25T23:50:13.000000Z
字数 362
阅读 1267
CODE
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;
int ncase;
int main()
{
int t;
cin >> t;
while(t--)
{
int n;
map<int,int>m;
cin >> n;
for(int i=0;i<n;i++)
{
int tp;
cin >> tp;
tp++;
m[tp]++;
}
map<int,int>::iterator it;
int ans=0;
for(it=m.begin();it!=m.end();it++)
{
ans+=((it->second+it->first-1)/it->first)*it->first;
}
printf("Case %d: %d\n",++ncase,ans);
}
return 0;
}