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

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int p[maxn];
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d",&p[i]);
		if(k!=1){
			int x=k;
			while(x--){
				if(p[i]==100)break;
				p[i]=10*(int)(sqrt(p[i])+0.9999999);
			}
		}
	}
	if(k==1){
		for(int i=0;i<n;i++){
			printf("%d",(int)(sqrt(p[i])+0.99999)*10);
			if(i==n-1)printf("\n");
			else printf(" ");
		}
		return 0;
	}
	for(int i=0;i<n;i++){
		printf("%d",p[i]);
		if(i==n-1)printf("\n");
		else printf(" ");
	}
	return 0;
}