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: 69ms
Memory: 4084kB
In contest: 1276

#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]);
	}
}