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

Обсуждение задачи 1380. Остаповские шахматы

If WA#9
Послано Timur Sitdikov (MSU Tashkent) 15 июл 2011 10:26
Try this:

0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 6 0 0 0 0 0
0 0 0 0 0 0 0 0
-3 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
1
White
c6-d7

Incorrect

0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 6 0 0 0 0 0
0 0 0 0 0 0 0 0
-3 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
Re: If WA#9
Послано Jane Soboleva (SumNU) 11 янв 2016 03:38
I had WA9 because i thought there would be only one king of the same color, but seems like actually there might be more. Thankfully to take more kings into account i had to delete some of my code rather than add some.

An example test:

0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
-1 0 0 0 0 0 0 0
0 -1 0 0 0 0 0 0
6 0 6 0 0 0 0 0
1
White
<any move> (for example a1-a2 or c1-c2)

The answer is "Incorrect" and then a table, because no matter what white does, there's at least one king remaining under check.

Also had WA7 because of using shortint and a bit too small constant for amount of available moves. After changing from 100 to 300 and from shortint to longint got AC.

An example test, where white have 288 available moves:

5 5 5 5 5 5 5 5
5 0 0 0 0 0 0 5
5 0 0 0 0 0 0 5
5 0 0 0 0 0 0 5
5 0 0 0 0 0 0 5
5 0 0 0 0 0 0 5
5 0 0 0 0 0 0 5
5 5 5 5 5 5 5 5
1
White
a1-b2

Result: "Draw" and table output.

Edited by author 11.01.2016 03:55