Result: Accepted
Time: 71ms
Memory: 2012kB
#include<bits/stdc++.h>
using namespace std;
//C
// time limit exceed
const int maxx = 1e5+10;
int chan(int x)
{
int y;
y = ceil(sqrt(x));
return y*10;
}
int main()
{
int n,k;
int arr[maxx];
scanf("%d %d",&n,&k);
for(int i = 0;i < n;++i)
scanf("%d",&arr[i]);
while(k--)
{
int tf = 0;
for(int i = 0;i < n;++i)
{
arr[i] = chan(arr[i]);
if(arr[i] == 100)
tf++;
}
if(tf == n)
break;
}
printf("%d",arr[0]);
for(int i = 1;i < n;++i)
printf(" %d",arr[i]);
printf("\n");
return 0;
}