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 |
哪位大哥大姐帮忙看看啊!不知道错哪里了??wa疯掉了!!!#include<stdio.h> #include<math.h> #include<stdlib.h> int main() { int t, x, m, i; scanf("%d %d", &t, &x); int minTime = 1000000000; scanf("%d", &m); int d, s; for(i = 0; i < m; ++i) { scanf("%d %d", &d, &s); if(d % s == 0 && minTime > d / s - 1)//整除的和不能整除的区别对待 minTime = d / s - 1; else if(d % s != 0 && minTime > d / s) minTime = d / s; } if(minTime <= 0) printf("0\n"); else printf("%d\n", (minTime + (t - minTime) / 2)*x); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator