!-- 自定制样式文件 -->

计蒜客 普及T1救援

 

 首先知道路径,房顶的位置是下,x和y。

每个人上船要1分钟,下船要0.5分钟,路程是没分钟50米,要计算来回时间

公式:s+=sqrt(x*x+y*y)/50+a*1+sqrt(x*x+y*y)/50+a*0.5

上代码:

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <stack>
#include <map>
#include <set>
#include <queue>
using namespace std;
int n,m;
double s,x,y,a;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>x>>y>>a;
s+=sqrt(x*x+y*y)/50+a*1+sqrt(x*x+y*y)/50+a*0.5;
}
cout<<(int)s+1;
return 0;
}

posted @ 2020-08-12 10:13  XzhouxxX  阅读(153)  评论(0编辑  收藏  举报