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: 60ms
Memory: 1116kB
In contest: 1276

#include <stdio.h>
#include <math.h>
int f(int x) {
   double s = sqrt(x);
   int r = s;
   if(s - r > 0) {
   	  r ++;
   } 
   return 10*r;
}

int main() {
    int n, k;
    int a;
    scanf("%d %d", &n, &k);
    for(int i = 0;i < n;i ++){
    	scanf("%d", &a);
    	for(int j = 0;j < k; j ++){
    	   a = f(a);
    	   if(a == 110 || a == 100) {
    	   	 break;
		   }
		}
		printf("%d ", a);
	}
	printf("\n");	
	return 0;
}