| ||||||||||
| 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 | |||||||||
管理员看一下吧 Bug问题/*
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator