ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Общий форум

TO ADMIN....PROBLEMS WITH NEW C++ JUDGE SYSTEM
Послано Igor Dex 14 дек 2003 03:46
Dear Admin,
I've just received "WA" to the solution of the problem 1084.
The solution is easy. There can't be any arguments about that.
The problems seem to be with the output of real numbers in the new
system. I use #include<iostream> #include<iomanip> and namespase std;
and after that some commands to format the output.
Such methods were enough to be accepted in the task from 1002...1061
where output with real numbers of some accuracy were required.
What has been changed now?
A lot of people would be grateful for the explanations.
Thanks in advance.
The "WA" program is included.

#include<iostream>
#include<math.h>
#include<iomanip>
using namespace std;

const double PI=3.14159265358979323846;

int main()
{
    double L, R, S;
    double alpha , betta;
    cin >> L >> R;

    if ( R < L/2. ) S = (PI * R * R )/2.;
    else if ( R*R > 0.5*L*L) S = L * L;
    else
    {
        alpha = acos( L/(2.*R) );
        betta = PI/2. - 2.* alpha;
        S = R * (L/2.) * sin (alpha);
        S += ( betta * R * R )/2.;
        S *= 4.;
    }
    cout.setf(ios_base::showpoint);  // cout << showpoint
    cout.setf(ios_base::fixed, ios_base::floatfield);// cout << fixed;
    cout.precision(3);                // cout << setprecision(3);
    cout << S << endl;
    return 0;
}
Re: TO ADMIN....PROBLEMS WITH NEW C++ JUDGE SYSTEM
Послано Igor Dex 14 дек 2003 05:25
Well, I encountered the same "accuracy" problem
in 1075(Of course, I took into considereation all possible positions
of the thread and a sphere).


> Dear Admin,
> I've just received "WA" to the solution of the problem 1084.
> The solution is easy. There can't be any arguments about that.
> The problems seem to be with the output of real numbers in the new
> system. I use #include<iostream> #include<iomanip> and namespase
std;
> and after that some commands to format the output.
> Such methods were enough to be accepted in the task from
1002...1061
> where output with real numbers of some accuracy were required.
> What has been changed now?
> A lot of people would be grateful for the explanations.
> Thanks in advance.
> The "WA" program is included.
>
> #include<iostream>
> #include<math.h>
> #include<iomanip>
> using namespace std;
>
> const double PI=3.14159265358979323846;
>
> int main()
> {
>     double L, R, S;
>     double alpha , betta;
>     cin >> L >> R;
>
>     if ( R < L/2. ) S = (PI * R * R );
>     else if ( R*R > 0.5*L*L) S = L * L;
>     else
>     {
>         alpha = acos( L/(2.*R) );
>         betta = PI/2. - 2.* alpha;
>         S = R * (L/2.) * sin (alpha);
>         S += ( betta * R * R )/2.;
>         S *= 4.;
>     }
>     cout.setf(ios_base::showpoint);  // cout << showpoint
>     cout.setf(ios_base::fixed, ios_base::floatfield);// cout <<
fixed;
>     cout.precision(3);                // cout << setprecision(3);
>     cout << S << endl;
>     return 0;
> }
>