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

Общий форум

I thing the text of 1014 is wrong
Послано Deian Lambov 18 ноя 2000 18:26
It is written that N<=10**6 and i found  that there is much
bigger N (N>10**9) in the test cases! With such N the
answer is bigger than MaxLongint!
Re: I thing the text of 1014 is wrong..NO
Послано Jivko Ganev 19 ноя 2000 00:32
var n : longint;
  A : array [2..9] of byte;
  i : byte;

begin
  readln(n);
  fillchar(A, sizeof(A), 0);
  if n = 0 then begin write(10); halt; end;
  if n = 1 then begin write(1); halt; end;
  for i := 9 downto 2 do
  while n mod i = 0 do
  begin
    inc(A[i]);
    n := n div i;
  end;
  if n <> 1 then write(-1) else
  begin
    for i := 2 to 9 do
    while A[i] <> 0 do
    begin
      dec(A[i]);
      write(i);
    end;
  end;
end.

This got accept no comment.
Re: I thing the text of 1014 is wrong..NO
Послано Deian Lambov 19 ноя 2000 22:59
> var n : longint;
>   A : array [2..9] of byte;
>   i : byte;
>
> begin
>   readln(n);
>   fillchar(A, sizeof(A), 0);
>   if n = 0 then begin write(10); halt; end;
>   if n = 1 then begin write(1); halt; end;
>   for i := 9 downto 2 do
>   while n mod i = 0 do
>   begin
>     inc(A[i]);
>     n := n div i;
>   end;
>   if n <> 1 then write(-1) else
>   begin
>     for i := 2 to 9 do
>     while A[i] <> 0 do
>     begin
>       dec(A[i]);
>       write(i);
>     end;
>   end;
> end.
>
> This got accept no comment.
Re: I thing the text of 1014 is wrong..NO
Послано Deian Lambov 19 ноя 2000 23:14

> This got accept no comment.

I've got accept with my own program, before I've posted
this message!
But I kept getting WA for a long time, because I thought
N<10**6(i didn't store the result in array )! Finaly  I
found that N>10**6! And I wrote this message because the
text of 1014 must be changed!
Re: I thing the text of 1014 is wrong..NO
Послано Jivko Ganev 20 ноя 2000 01:55
Ok man.Drink a cold glass of water then go read the
text.There is no single spot in the problem text where it
says that the output number Q has to be <= 10**6.
Re: I thing the text of 1014 is wrong..NO
Послано Deian Lambov 20 ноя 2000 14:27
> Ok man.Drink a cold glass of water then go read the
> text.There is no single spot in the problem text where it
> says that the output number Q has to be <= 10**6.

But if N<=10**6 then Q is not bigger than LongInt!
Re: I thing the text of 1014 is wrong..NO
Послано Jivko Ganev 20 ноя 2000 14:59
I have to agree on that.I added the line if n > 1000000
then halt; and my program stopped working.
Re: I thing the text of 1014 is wrong..NO
Послано Deian Lambov 20 ноя 2000 16:30
> I have to agree on that.I added the line if n > 1000000
> then halt; and my program stopped working.
I did the same:)
As far as I remember n<=10**9(instead of n<=10**6)!
fixed
Послано Marat Bakirov 21 ноя 2000 12:06
Thanks, man. You are right. That was a misprint.