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

Общий форум

Please, help me with problem 1124!
Послано Nazarov Denis (nsc2001@rambler.ru) 11 янв 2002 22:16
Be more detailed about what kind of help you need(-)
Послано Michael_Rybak 12 янв 2002 02:00
>
Re: Be more detailed about what kind of help you need(+)
Послано Nazarov Denis (nsc2001@rambler.ru) 12 янв 2002 14:06
My program:

Program t1124;

Var M,N,i,j,k,a  :integer;
    c            :array[1..500]of integer;

begin
a:=0;
fillchar(c,sizeof(c),0);
read(m,n);
for i:=1 to m do
 for j:=1 to n do begin
  read(k);
  if k<>i then begin
   a:=a+1;
   c[i]:=c[i]+1;
  end;
 end;
j:=0;
for i:=1 to m do
 if c[i] mod 2=1 then
  j:=j+1;
if j>0 then a:=a+(j div 2)-1;
writeln(a);
end.

It get WA.
The wrong test:
4
1 2 2
2 1 1
3 4 4
4 3 3
Rigth answer:9
My program's answer:8.

How i can find in program code a such kind of tests?
Count the number of connected components in the graph...(-)
Послано Michael_Rybak 12 янв 2002 22:57