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

Обсуждение задачи 1099. Work Scheduling

Показать все сообщения Спрятать все сообщения

Please help. My program fails test validation at test #3. Michael Rybak (accepted@ukr.net) 1 окт 2004 23:49
There's already such information posted here by RightAnswer in 2001, which says, that there are 2 equal numbers in a line in test data.
 As for me, I have a procedure in my program, called DoCrash, which consist of a single Halt operator. The only place where I call it in the program is right after Readln(i,j) when reading another line of input data. I have such a line right after this:
 If i=j Then DoCrash;

My program gets WA on test 3. If I try changing consitance of DoCrash procedure to "While True Do", I get  TL. This should mean that there ARE 2 equal numbers in some line, as far as I understand, shouldn't it? Please help me with my confusion.
There actually IS a line (i,j) in input data, where i=j, although it contradicts the problem statement ("no guard can walk alone"). You should ignore it, and process the rest of the test normally.
see in (+) Vladimir Yakovlev (USU) 3 окт 2004 01:13
You're right - there tests with i=j in it.
I think this is not so big problem, because typical solution read pairs in such way:
while (scanf("%d %d", &x, &y) != EOF)
adj[x][y] = adj[y][x] = 1;
Nevertheless, I cut all pairs of equal numbers from tests. You may not worry about correctness of tests now.
Particularly, my input was like this:
readln(x,y);
if a[x,y]=1 then continue;
a[x,y]:=1;
inc(ne[x]);// number of going from x
e[x,ne[x]]:=y;// e[x,..] - list of edges from x
inc(ne[y]);
e[y,ne[y]]:=x;

so you see, that (i,i) pairs do cause problems in my case, because I treat them as possible edges to go through.
 Anyway, thank you for making the test correct.