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

Обсуждение задачи 1010. Дискретная функция

If you have WA2
Послано Andrew Sboev 5 июл 2012 17:47
1) Maybe, you are reading long long variable with this command :
  scanf("%d",&arr[i]);
  It is not right. You should do, for example, it with next command
  scanf("%I64d",&arr[i]);
2) Maybe, you were confused by statement. You have to choose such two points so line that passing through this points has maximal absolute value of inclination, not just inclination.
3) Maybe, you are doing something like this :
    for ( int i = 1 ; i <= n ; ++i ) {
      long long d = abs2(arr[i+1] - arr[i]);

       if ( d > x ) {
                 x = d; m1 = i;
       }
   }
There is a mistake in first line. Right way is
   for ( int i = 1 ; i < n ; ++i ) {

It was my biggest mistake, because the problem itself is so simple.
Re: If you have WA2
Послано kaa..........ai 30 июн 2013 15:34
Thannnnnnnnnnnnnnnnnk youuuuuuuuuuuuuu verrrrrrrrrrrrry mucccccccccccccch!
Re: If you have WA2
Послано Lytning 25 сен 2014 19:42
Thannnnnnnnnnnnnnnnnk youuuuuuuuuuuuuu verrrrrrrrrrrrry mucccccccccccccch!
Re: If you have WA2
Послано whyno11 2 сен 2017 15:49
Thanks a lot! The definition of inclination is ambiguous in the problem statement.
Re: If you have WA2
Послано Myrcella 21 авг 2018 08:12
Thanks a lot! I have ignored "absolute value" too.
Re: If you have WA2
Послано STK@fire 27 авг 2018 11:07
Thannnnnnnnnnnnnnnnnk youuuuuuuuuuuuuu verrrrrrrrrrrrry mucccccccccccccch!
Re: If you have WA2
Послано abid1729 27 май 2019 21:32
Thannnnnnnnnnnnnnnnnk youuuuuuuuuuuuuu verrrrrrrrrrrrry mucccccccccccccch!