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: 57ms
Memory: 2132kB
In contest: 1276

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<math.h>
#include<string.h>
#include<cstring>
using namespace std;
int c[100010];
int main(void)
{
	//printf("%f\n",sqrt(10.0));

	/*int tmp = 1;
	for(int j = 0;j < 100;j++)
				{
					tmp = (int)ceil(sqrt(tmp * 1.0)) * 10;
					printf("%d\n",tmp);
				}
	printf("%d",tmp);*/

	int n,k,i;
	while(~scanf("%d %d",&n,&k))
	{
		for(i = 0;i < n;i++)
		{
			scanf("%d",c + i);
		}
		for(int j = 0;j < k;j++)
		{
			c[i] = (int)ceil(sqrt(c[i] * 1.0));

		}
		if(k >= 50)
		{
			for(i = 0;i < n;i++)
			{
				printf("100");
				if(i != n - 1)
				{
					printf(" ");
				}
			}
			printf("\n");
		}
		else
		{
			for(i = 0;i < n;i++)
			{
				for(int j = 0;j < k;j++)
				{
					c[i] = (int)ceil(sqrt(c[i] * 1.0)) * 10;
				}
				printf("%d",c[i]);
				if(i != n - 1)
				{
					printf(" ");
				}
			}
			printf("\n");
		}
	}
	return 0;
}