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: 72ms
Memory: 1388kB
In contest: 1276

#include<stdio.h>
#include<string.h>
#include<math.h>

long f(int x){
	int a;
	double b;
	b=sqrt((double)x)-(int)sqrt((double)x);
	if(b>0.0)
		b=(int)sqrt((double)x)+1;
	else
		b=(int)sqrt((double)x);
	return 10*(int)b;
}

void main(){
	int n,k,a[100001],i,j;
	scanf("%d %d",&n,&k);
	i=1;
	while(n--){
		scanf("%d",&a[i++]);
		for(j=1;j<=k;j++){
			a[i-1]=f(a[i-1]);
			if(a[i-1]==100)
				break;
		}
		printf("%d\n",a[i-1]);
	}
}