Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:这个*2.应该是这样的。。In Reply To:顶一下,牛人来解释一下,这个*2........ Posted by:bluewind at 2006-04-15 19:57:06 The plow can clear exactly one lane of a road in a single pass. All roads are perfectly straight, with one lane in each direction。 所一一条路需要来回各走一次才能清理完。因此车一直在雪上行走。 #include <cstdio> #include <cmath> int main() { char line[256]; while(gets(line) != NULL) { double d = 0; double bx, by, ex, ey; while(gets(line) != NULL && line[0] != 0) { sscanf(line, "%lf %lf %lf %lf", &bx, &by, &ex, &ey); d += sqrt((bx-ex)*(bx-ex)+(by-ey)*(by-ey)); } int t = (int)(d/1000*2/20*60 + 0.5); printf("%d:%02d\n", t/60, t%60); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator