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

#include<stdio.h>
#include<math.h>
int f(double x)
{
	int s;
	s=ceil(sqrt(x))*10;
	return(s);
}
int main()
{
	int n,k,i,j,a[100001];
	scanf("%d %d",&n,&k);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	if(k<4)
	{
		for(j=1;j<=k;j++)
		{
			for(i=1;i<=n;i++)
			{
				a[i]=f((double)a[i]);
			}
		}
		for(i=1;i<n;i++)
	   {
		   printf("%d ",a[i]);
	   }printf("%d\n",a[n]);
	}
	else
	{
		for(j=1;j<=k;j++)
		{
			a[1]=f((double)a[1]);
		}
		for(i=1;i<n;i++)
		{
			printf("%d ",a[1]);
		}printf("%d\n",a[1]);
	}
}