3 条题解

  • 3
    @ 2025-1-20 18:02:59

    #include <bits/stdc++.h> using namespace std; int main(){ int n; scanf("%d", &n); double sum = 0; for (int i = 1; i <= n; i++){ double x, y;//注意是 double 类型 int p; scanf("%lf%lf%d", &x, &y, &p); double dis = sqrt(x * x + y * y); sum += dis / 50 + p + dis / 50 + p * 0.5; //船往返的时间总和 } printf("%d\n", int(ceil(sum)));//向上取整函数 return 0; }

    • 2
      @ 2025-4-13 11:22:42
      #include <bits/stdc++.h> 
      using namespace std; 
      int main(){ 
      	int n; 
      	scanf("%d", &n); 
      	double sum = 0; 
      	for (int i = 1; i <= n; i++){ 
      		double x, y;
      		int p; 
      		scanf("%lf%lf%d", &x, &y, &p); 
      		double dis = sqrt(x * x + y * y); 
      		sum += dis / 50 + p + dis / 50 + p * 0.5; 
      	}
      	printf("%d\n", int(ceil(sum)));
      	return 0;
      }
      
      • 1
        @ 2025-1-20 10:20:55

        #include <bits/stdc++.h>

        using namespace std;

        int main(){

        int n;
        
        int p;
        
        double x,y;
        
        double t,tot;
        
        scanf("%d",&n);
        
        while(n--){
        
        	scanf("%lf%lf%d",&x,&y,&p);
        
        	t=sqrt(x\*x+y\*y);
        
        	tot+=(t/50)\*2+1.5\*p;
        
        }
        
        printf("%d",(int)ceil(tot));
        
        return 0;
        

        }

        • 1

        信息

        ID
        64
        时间
        1000ms
        内存
        128MiB
        难度
        5
        标签
        (无)
        递交数
        89
        已通过
        36
        上传者