ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

Problem 1020 Test 4 Wrong Answer
Posted by vasya 28 Jul 2009 22:24
Program
#include <iostream>
#include <math.h>
using namespace std;

#define M_PI       3.14159265358979323846

int main()
{
    int n, r;

    cin>>n>>r;

    double s = 2*M_PI*r;

    double x[101];
    double y[101];

    for(int i =0; i < n; i++)
        cin>>x[i]>>y[i];


    for(int i=0; i <n-1; i++)
    {
        s+= sqrt(pow((x[i]-x[i+1]),2)+pow((y[i]-y[i+1]),2));

    }

    s+= sqrt(pow((x[n-1]-x[0]),2)+pow((y[n-1]-y[0]),2));

    printf("%.2f\n",s);

    return 0;
}

Why will be Test 4 to do wrong answer?
Извиняюсь за свой никакой английский, в чем может быть
проблема?
Re: Problem 1020 Test 4 Wrong Answer
Posted by Sergey Lazarev (MSU Tashkent) 28 Jul 2009 23:22
"a real number R — a radius of heads of nails"
But in your program R - integer.
Re: Problem 1020 Test 4 Wrong Answer
Posted by vasya 29 Jul 2009 01:08
thanks, i didn't pay much attention ))