Result: Accepted
Time: 69ms
Memory: 4084kB
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
const int maxn=100000;
int n,k;
double b[maxn],d[maxn];
int a[maxn],c[maxn];
void sum(int n){
for(int i=0;i<n;i++){
b[i]=sqrt(a[i]);
c[i]=sqrt(a[i]);
d[i]=c[i]*1.0;
if(b[i]!=d[i])c[i]+=1;
}
for(int i=0;i<n;i++){
a[i]=10*c[i];
}
}
int main(){
scanf("%d %d",&n,&k);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
if(k<=10){
while(k--){
sum(n);
}
}
else{
for(int i=0;i<n;i++)a[i]=100;
}
for(int i=0;i<n;i++){
if(i!=0)
printf(" ");
printf("%d",a[i]);
}
}