(以“分类:模拟与排序 ==摘要== {{信息题|Wasted Time|http://acm.hust.edu.cn/vjudge/contest/view.action?cid{{=}}70200#problem/A|2|100|time=2015-02-14 13:42:4...”为内容创建页面) |
小 (→摘要: 难度) |
||
| 第1行: | 第1行: | ||
[[分类:模拟与排序]] | [[分类:模拟与排序]] | ||
==摘要== | ==摘要== | ||
| − | {{信息题|Wasted Time|http://acm.hust.edu.cn/vjudge/contest/view.action?cid{{=}}70200#problem/A| | + | {{信息题|Wasted Time|http://acm.hust.edu.cn/vjudge/contest/view.action?cid{{=}}70200#problem/A|1|100|time=2015-02-14 13:42:48}} |
*来自寒假练习:[http://acm.hust.edu.cn/vjudge/contest/view.action?cid=70200 Special Round for Valentine's Day] A题 | *来自寒假练习:[http://acm.hust.edu.cn/vjudge/contest/view.action?cid=70200 Special Round for Valentine's Day] A题 | ||
*原题链接:http://codeforces.com/problemset/problem/127/A | *原题链接:http://codeforces.com/problemset/problem/127/A | ||
| + | |||
==题意== | ==题意== | ||
给出折线经过的点,求路径总长度。 | 给出折线经过的点,求路径总长度。 | ||
| 题目链接 | 难度等级 | 完成状态 | 完成分数 | 最后编辑时间 | 需要注意 |
|---|---|---|---|---|---|
| Wasted Time | ★☆☆☆☆ | 答案正确 | 100 | 2015-02-14 13:42:48 | 无 |
给出折线经过的点,求路径总长度。
求个距离,求个和。签到题。
| 127A.cpp代码已折叠
展开折叠内容
|
|---|
#include<cstdio>
#include<cmath>
#define si(n) scanf("%d",&n)
#define f(i,n) for(int i=1;i<=n;++i)
int main()
{
int n,k,x,y,lx,ly;
double ans=0;
si(n);si(k);
f(i,n)
{
si(x);si(y);
if(i>1)
{
ans+=sqrt((x-lx)*(x-lx)+(y-ly)*(y-ly))/50.0;
}
lx=x,ly=y;
}
printf("%.9lf",ans*k);
return 0;
}
|