Result: Accepted
Time: 57ms
Memory: 2132kB
#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;
}