Start: Jun, 28, 2019 08:42:00
2019杭州师范大学第一届程序设计竞赛新生赛
End: Jun, 28, 2019 11:42:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 64ms
Memory: 2108kB
In contest: 1276

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cmath>
using namespace std;
int n,k,i;
int a[100010];
/*double ff(double x){
	double t=sqrt(x);
	if((int)t!=t)	t++;
	double z=(int)t;
	return (double)(z*10);
}*/
int main(){
	scanf("%d %d",&n,&k);
	for(i=1;i<=n;i++){
		scanf("%d",&a[i]);
	}
	for(i=1;i<=n;i++){
		if(a[i]>=82)	a[i]=100;
		else if(a[i]>=65&&a[i]<=81){
			if(k==1)	a[i]=90;
			else	a[i]=100;
		}
		else if(a[i]>=50&&a[i]<=64){
			if(k==1)	a[i]=80;
			else if(k==2)	a[i]=90;
			else	a[i]=100;
		}	
		else if(a[i]>=37&&a[i]<=49){
			if(k==1)	a[i]=70;
			else if(k==2)	a[i]=90;
			else	a[i]=100;
		}
		else if(a[i]>=26&&a[i]<=36){
			if(k==1)	a[i]=60;
			else if(k==2)	a[i]=80;
			else if(k==3)	a[i]=90;
			else	a[i]=100;
		}
		else if(a[i]>=17&&a[i]<=25){
			if(k==1)	a[i]=50;
			else if(k==2)	a[i]=80;
			else if(k==3)	a[i]=90;
			else	a[i]=100;
		}
		else if(a[i]>=10&&a[i]<=16){
			if(k==1)	a[i]=40;
			else if(k==2)	a[i]=70;
			else if(k==3)	a[i]=90;
			else	a[i]=100;
		}
		else if(a[i]>=5&&a[i]<=9){
			if(k==1)	a[i]=30;
			else if(k==2)	a[i]=60;
			else if(k==3)	a[i]=80;
			else if(k==4)	a[i]=90;
			else	a[i]=100;
		}
		else if(a[i]>=2&&a[i]<=4){
			if(k==1)	a[i]=20;
			else if(k==2)	a[i]=50;
			else if(k==3)	a[i]=80;
			else if(k==4)	a[i]=90;
			else	a[i]=100;
		}
		else if(a[i]==1){
			if(k==1)	a[i]=10;
			else if(k==2)	a[i]=40;
			else if(k==3)	a[i]=70;
			else if(k==4)	a[i]=90;
			else	a[i]=100;
		}
		printf("%d ",a[i]);
	}
}