Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

We have a page titled FAQ for a reason.

Posted by frkstyc at 2009-05-18 14:23:45
In Reply To:管理员看一下吧 Bug问题 Posted by:yizer at 2009-05-18 14:00:20
> /*
> PKU 1939
> Author : Yizer
> */
> #include <iostream>
> #include <algorithm>
> #include <functional>
> #include <vector>
> #include <queue>
> #include <stack>
> #include <map>
> #include <set>
> #include <string>
> #include <cmath>
> #include <stdio.h>
> #include <string.h>
> using namespace std;
> 
> int n;
> int main()
> {
> 	
> 	double a[1000],b[1000],x[1000],y[1000];
> 
> 	while (scanf("%d",&n)!=EOF)
> 	{
> 		for (int i=0;i<n;i++)
> 			scanf("%lf%lf",&a[i],&b[i]);
> 		for (int i=0;i<n-1;i++)
> 		{
> 			x[i] = (a[i]+a[i+1])/2;
> 			y[i] = (b[i]+b[i+1])/2;
> 		}
> 		x[n-1] = (a[n-1]+a[0])/2;
> 		y[n-1] = (b[n-1]+b[0])/2;
> 
> 		printf("%d",n);
> 		for (int i=0;i<n;i++)
> 			printf(" %.6lf %.6lf",x[i],y[i]);
> 		puts("");
> 	}
> 	return	0;
> }
> 
> 这个代码C++交AC
> G++提交TLE
> 非常诡异
> 一个32msAC一个TLE

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator