313 条题解
-
0liuganyu LV 3 @ 2009-01-28 16:19:47
原来是按逆时针顺序给坐标啊
我还以为要自己判断那两个点相连呢
弄得我一个一个去判断那两个点相连……
最后还是有一个点没AC
不知道原因
还是按照题目意思
-
02009-01-24 12:15:21@
55我考虑得非常全,包括N=1,本来应该一次 AC的.但是输出N=1的情况时,我忘了更改输出格式.....55
-
02009-01-20 19:58:18@
var a,b:array[1..1000] of real;
i,n:longint;
r,t:real;
begin
readln(n,r);
for i:=1 to n do
read(a[i],b[i]);
t:=0;
for i:=1 to n-1 do
t:=t+sqrt(sqr(a-a[i])+sqr(b-b[i]));
t:=t+sqrt(sqr(a[n]-a[1])+sqr(b[n]-b[1]));
t:=t+2*3.1415926*r;
writeln(t:0:2);
end. -
02009-01-19 23:19:31@
答案错误...程序输出比正确答案长
-
02009-01-19 14:08:09@
#include
using namespace std;
#includedouble direct(double a, double b, double c, double d)
{
return sqrt((a-c)*(a-c)+(b-d)*(b-d));
}int main()
{
int N;
double R,C = 0;
cin >> N >> R;double x[100+5],y[100+5];
for (int i = 0; i < N; i++)
{
cin >> x[i] >> y[i];
}x[N] = x[0];
y[N] = y[0];for (int i = 0; i < N; i++)
{
C += direct(x[i],y[i],x,y);
}C += 2*acos(-1)*R;
printf("%.2lf",C);
return 0;
} -
02009-01-15 19:51:57@
program zsr4;
const
y=3.14159;
var
n,i,j:longint; r,z,l:real;
a:array[1..101,1..2]of real;
begin
readln(n,r);
for i:=1 to n do readln(a,a);
a[n+1,1]:=a[1,1];a[n+1,2]:=a[1,2];
for i:=1 to n do begin
l:=sqrt(sqr(abs(a-a))+sqr(abs(a-a)));
z:=z+l;
end;
l:=2*r*y;
z:=z+l;
writeln(z:0:2);
end. -
02009-01-15 10:19:39@
program Project1;
var s1,s2,k:array[1..100] of real;
n,i:integer;
r,a:real;begin a:=0;
readln(n,r);
for i:=1 to n-1 do
readln(s1[i],s2[i]);
for i:=1 to n do
begin k[i]:=sqrt(sqr((s1-s1[i]))+sqr((s2-s2[i])));a:=a+k[i];
end;
a:=a+3.141592658*2*r;
write(a:0:2);end.
-
02009-01-03 11:00:58@
我还以为是凸包算法呢~~~~~~~~~~~~~~~~~~~~
无语。。。。。。。。。。。。。
但还是accepted了.-" "-.
/ \
| |
|, .-. .-. ,|
| )(__/ \_)( |
|/ /\ |
(@ (_ ^^ _)
_ ) ____|\__|\_|IIIIII|\_/\__|\__|\__|\__|\__|\__|\__|\__|__
(_)@8@8{}
)/ \ /
(@ `---|---|--` -
02008-12-30 18:33:41@
program dingzi;
type
ding=record
x,y:real; end;
var a:array[1..100]of ding;
i,n:integer;
r,sum:real;
function s(p1,p2:ding):real;
begin
s:=sqrt(sqr(p1.x-p2.x)+sqr(p1.y-p2.y));
end;
begin
readln(n,r);
for i:=1 to n do readln(a[i].x,a[i].y);
a[n+1].x:=a[1].x;
a[n+1].y:=a[1].y;
for i:=1 to n do sum:=sum+s(a[i],a);
sum:=sum+2*pi*r;
writeln(sum:0:2);end.
我哪错了? -
02008-12-19 12:58:09@
var
i,j,s,m,n:integer; k,x1,y1,r,c,x,y:real;
a:array[1..100,1..2]of real;
begin
read(n); read(r);
for i:=1 to n do
for j:=1 to 2 do
read(a);
for i:=1 to n-1 do
begin
c:=c+sqrt(sqr(a-a)+sqr(a-a));
end;
x1:=sqrt(sqr(a[n,1]-a[1,1])+sqr(a[n,2]-a[1,2]));
k:=2*r*3.14159;
c:=c+k+x1;
writeln(c:0:2);
end.好水啊,
-
02008-12-11 20:10:27@
var a,b:array[1..1000] of real;
i,n:longint;
r,t:real;
begin
readln(n,r);
for i:=1 to n do
read(a[i],b[i]);
t:=0;
for i:=1 to n-1 do
t:=t+sqrt(sqr(a-a[i])+sqr(b-b[i]));
t:=t+sqrt(sqr(a[n]-a[1])+sqr(b[n]-b[1]));
t:=t+2*3.1415926*r;
writeln(t:0:2);
end. -
02008-12-11 14:32:06@
program dingzi;
type
ding=record
x,y:real; end;
var a:array[1..100]of ding;
i,n:integer;
r,sum:real;
function s(p1,p2:ding):real;
begin
s:=sqrt(sqr(p1.x-p2.x)+sqr(p1.y-p2.y));
end;
begin
readln(n,r);
for i:=1 to n do readln(a[i].x,a[i].y);
a[n+1].x:=a[1].x;
a[n+1].y:=a[1].y;
for i:=1 to n do sum:=sum+s(a[i],a);
sum:=sum+2*pi*r;
writeln(sum:0:2);end. -
02008-12-11 14:04:25@
program dingziwenti;
const pi=3.1415926535;
type dz=record
x,y:real;
end;
var node:dz;
a:array[1..100] of dz;
i,n:integer;
r,l,k,h:real;
function line(a,b:dz):real;
begin
line:=sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));
end;
begin
readln(n,r);k:=0;
for i:=1 to n do readln(a[i].x,a[i].y);
a[n+1].x:=a[1].x;
a[n+1].y:=a[1].y;
for i:=1 to n do begin k:=k+line(a[i],a); end;
h:=2*pi*r;
k:=k+h;
write(k:0:2);
end. -
02008-12-11 10:53:26@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0msprogram dingziwenti;
const pi=3.1415926535;
type dz=record
x,y:real;
end;
var node:dz;
a:array[1..100] of dz;
i,n:integer;
r,l,k,h:real;
function line(a,b:dz):real;
begin
line:=sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));
end;
begin
readln(n,r);k:=0;
for i:=1 to n do readln(a[i].x,a[i].y);
a[n+1].x:=a[1].x;
a[n+1].y:=a[1].y;
for i:=1 to n do begin k:=k+line(a[i],a); end;
h:=2*pi*r;
k:=k+h;
write(k:0:2);
end. -
02008-12-08 13:26:59@
program p1007;
const
pi=3.141592653;
var
n,i:integer;
r,l:real;
a,b:array[0..100] of real;
begin
readln(n,r);
for i:=1 to n do readln(a[i],b[i]);
a[0]:=a[n];b[0]:=b[n];
for i:=1 to n do
begin
l:=l+sqrt(sqr(a[i]-a)+sqr(b[i]-b));
end;
l:=l+2*pi*r;
writeln(l:0:2);
end. -
02008-12-07 14:11:34@
垃圾啊!
program v1007;
const p=3.14159;
var
n,i:integer;
r:real;l:extended;
a,b:array[1..101]of real;
begin
readln(n,r);
for i:=1 to n do readln(a[i],b[i]);
for i:=1 to n-1 do
l:=l+sqrt(sqr(a-a[i])+sqr(b-b[i]));
l:=l+sqrt(sqr(a[n]-a[1])+sqr(b[n]-b[1]));
l:=l+2*p*r;
writeln(l:0:2);
end. -
02008-12-06 21:50:11@
#include
#include
using namespace std;int main()
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
const double pi=3.1415;
int n,i;
double r,l;
cin >> n >> r;
double a[n],b[n];
for (i=0;i> a[i] >> b[i];
l=pi*r*2;
if (n==1)
cout -
02008-12-03 15:34:47@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms -
02008-11-30 22:17:48@
program vijos;
const
pi=3.1415926;
var
k,t,m,r :real;
x,y,x1,y1,x2,y2 :real;
i,n :integer;
begin
m:=0;
read(n,r);
read(x,y);
x1:=x;
y1:=y;
for i:=2 to n do
begin
read(x2,y2);
m:=m+sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
x1:=x2;
y1:=y2;
end;
m:=m+sqrt((x2-x)*(x2-x)+(y2-y)*(y2-y));
m:=m+pi*2*r;
writeln(m:0:2);
end.
为什么第三组解错了? -
02008-11-30 18:39:57@
现在才知道凸多边形外角和为2*pi。。。哎。。