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: 59ms
Memory: 2520kB
In contest: 1276

#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<queue>
using namespace std;
const int maxn=1e5+9;
const int inf=0x3f3f3f3f;
typedef long long ll;
ll num[maxn];
int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    for(int i=1;i<=n;i++) scanf("%lld",&num[i]);
    for(int i=1;i<=k;i++){
    	int flag=0;
    	for(int j=1;j<=n;j++){
//    		if(sqrt(num[j])==(ll)sqrt(num[j])){
//    			num[j]=10*(ll)sqrt(num[j]);
//			}
//			else num[j]=10*(1+(ll)sqrt(num[j]));
            num[j]=10*(ll)(ceil(sqrt(num[j])));
            if(num[j]==100) flag++;
		}
		if(flag==n) break;
	}
	for(int i=1;i<=n;i++) printf("%lld ",num[i]);
	printf("\n");
	return 0;
}