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

Discussion of Problem 1020. Rope

Why do I get CE????? Please help!!!!!
Posted by Ostap Korkuna 1 Jun 2004 18:11
#include <iostream.h>
#include <math.h>

int main(){
    int N, R;
    cin>>N>>R;
    int i;
    double t1_x, t2_x, tf_x, t1_y, t2_y, tf_y;
    cin>>tf_x>>tf_y;
    t1_x=tf_x;
    t1_y=tf_y;
    double sum_l=0;
    for(i=1; i<N; i++){
        cin>>t2_x>>t2_y;
        sum_l+=sqrt((t2_x-t1_x)*(t2_x-t1_x)+(t2_y-t1_y)*(t2_y-t1_y));
        t1_x=t2_x;
        t1_y=t2_y;
    }
    if (N>1)
        sum_l+=sqrt((t2_x-tf_x)*(t2_x-tf_x)+(t2_y-tf_y)*(t2_y-tf_y));

    int sum=int((sum_l+2*R*2*acos(0))*100);
    cout<<double(sum)/100;
    return 0;
}
Re: Why do I get CE????? Please help!!!!!
Posted by Yosif Yosifov 1 Jun 2004 19:05
#include <iostream>
using namespace std;

NOT
#include <iostream.h>
Re: Why do I get CE????? Please help!!!!!
Posted by Ostap Korkuna 1 Jun 2004 19:32
I know my mistake. I tryed to count acos(0), but 0 is int and acos has double parameters. I changed to acos(0.0)

Edited by author 01.06.2004 20:20

Edited by author 01.06.2004 20:27