2 条题解

  • 0
    @ 2025-9-20 20:20:49
    from math import sqrt,ceil,gcd,log;re=lambda:map(int,input().strip().split())
    
    while True:
        try:
            n, = re()
            a = list(re())
            b = sum(sqrt(i) for i in a)
            print("Yes" if b == int(b) else "No")
        except:
            break
    
    • 0
      @ 2023-11-20 18:07:16
      #include <stdio.h>
      #include <math.h>
      
      int main(){
      	int n;
      	while(scanf("%d",&n)!=EOF){
      		int a[n];
      		double sum=0;
      		for(int i=0;i<n;i++){
      			scanf("%d",&a[i]);
      			double x=sqrt(a[i]);
      			sum+=x;
      		}
      		int x=sum;
      		if(x*10==sum*10){
      			printf("Yes\n");
      		}
      		else{
      			printf("No\n");
      		}
      	}
      
      	return 0;
      }
      
      • 1

      信息

      ID
      239
      时间
      1000ms
      内存
      256MiB
      难度
      7
      标签
      递交数
      455
      已通过
      88
      上传者