###### coderforce 581C. Developing Skills

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
const int maxm=1e5+10;
struct node
{
int x,id;
}t[maxm];
int cmp(node p,node q)
{
return p.id>q.id;
}
int main()
{
int n,k;
while(scanf("%d%d",&n,&k)!=EOF)
{
for(int i=0;i<n;i++)
{
scanf("%d",&t[i].x);
t[i].id=t[i].x%10;
}
sort(t,t+n,cmp);
int sum=0;
int cnt=0;
for(int i=0;i<n;i++)
{
int mod=t[i].x%10;
int f=t[i].x/10;
if(mod!=0)
{
if(mod+k>=10)
{
k-=(10-mod);
t[i].x+=(10-mod);
}
else
{
t[i].x+=k;
k=0;
}
sum+=(t[i].x/10);
}
else
{
sum+=f;
}
if(t[i].x<100)
{
cnt+=((100-t[i].x)/10);
}
}
while(k>=10&&cnt>0)
{
k-=10;
sum+=1;
cnt--;
}
printf("%d\n",sum);
}
return 0;
}

#### CF#322-C-Developing Skills-模拟大水题

2015-09-28 21:55:11

#### 解题报告 之 CodeForces 581C Developing Skills

2015-09-28 23:38:56

#### Developing Skills

2015-09-29 18:31:22

#### Coderforce题解

2015-12-21 19:48:24

#### 50 Activities for Developing People Skills

2008年10月26日 906KB 下载

#### codeforces 581C Developing Skills

2016-05-02 18:43:38

#### Developing Skills（优先队列）

2015-09-29 00:52:48

#### codeforces 581C Developing Skills

2015-10-10 19:15:42

#### CF581C：Developing Skills解题报告

2015-09-30 01:41:44

#### Codeforces 581C Developing Skills

2015-09-28 22:36:16

## 不良信息举报

coderforce 581C. Developing Skills