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 |
为什么TLE?/* * Time Limit Exceeded * typedef struct _node{ double x; double y; }Node; Node a[30000]; int main() { int n = 0; double mx; double my; while (scanf("%d", &n) != EOF) { for (int i = 0; i < n; ++i) scanf("%lf%lf", &a[i].x, &a[i].y); a[n].x = a[0].x; a[n].y = a[0].y; printf("%d", n); for (int i = 0; i < n; ++i) { mx = (a[i].x + a[i + 1].x) / 2.0; my = (a[i].y + a[i + 1].y) / 2.0; printf(" %.6lf %.6lf", mx, my); } printf("\n"); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator