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: 62ms
Memory: 2100kB
In contest: 1276

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int gcd(int a,int b)
{
	return b?gcd(b,a%b):a;
}
int t,n,k;
int x[maxn];
string s;
int f(int x)
{
	return (int)(sqrt(x)+0.9999)*10;
}
int main()
{
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		int a;
		scanf("%d",&a);
		for(int j=1;j<=k;j++)
		{
			int m=f(a);
			if(m==a)break;
			a=m;
		}
		printf("%d",a);
		if(i==n)printf("\n");
		else printf(" ");
	}
}