#include<bits/stdc++.h> using namespace std; int main(){ int n,a1=0,b1=0; double ans=0; cin>>n; while(n--){ int a,b; cin>>a>>b; ans+=sqrt(pow(a1-a,2)+pow(b1-b,2)); a1=a; b1=b; } ans+=sqrt(pow(a1-0,2)+pow(b1-0,2)); printf("%.12lf",ans); }
注册一个 oirush 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 oirush 通用账户