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

Обсуждение задачи 1178. Дороги Акбардина

Who can help me?Write to this address:yuyuanming163@163.com
Послано Tony 30 сен 2002 15:46
Re: I have got AC!!!
Послано Tony 30 сен 2002 17:34
follow is my program:
var
 a:array[1..10000]of longint;
 z:array[1..10000]of integer;
 i,j,k,n:longint;
begin
 fillchar(a,sizeof(a),0);
 fillchar(z,sizeof(z),0);
 read(n);
 for i:=1 to n do begin read(a[i],j);z[i]:=i;end;
 for i:=1 to n-1 do
  for j:=i+1 to n do
   if a[z[i]]>a[z[j]] then
    begin
     k:=z[i];
     z[i]:=z[j];
     z[j]:=k;
    end;
 i:=0;
 while i<n do
  begin
   writeln(z[i+1],' ',z[i+2]);
   inc(i,2);
  end;
end.
But your solution is wrong!
Послано Vlad Veselov 30 апр 2004 22:28
Try this:
4
1 1
1 3
1 2
1 4
Your program says
1 2
3 4
but those roads intersect.
My first solution was wrong also, but I sort towns by polar angle and I can choose center randomly.
TO JUDGES: Can you add few tests that catch solutions, which sort towns only by X or by Y?
Sorry, I didn't read statement carefully: "No three towns lay on one line. "
Послано Vlad Veselov 30 апр 2004 22:35
Re: I have got AC!!!
Послано nickolas stoudemire 25 авг 2007 10:28
Your solution looks so strange!
Can you tell me why it works?
Re: I have got AC!!!
Послано nickolas stoudemire 25 авг 2007 10:31
Ha!
Very funny!
I got it!
Oh, yeah!!!!!!!!!!!!!
Re: I have got AC!!!
Послано nickolas stoudemire 25 авг 2007 10:32
Oh, you needn't explain it to me any more.
I have understood it!
Re: I have got AC!!!
Послано Enigma [UB of TUIT] 21 окт 2011 14:33
bravoooo!!! Your idea is very good.
Re: But your solution is wrong!
Послано AYUBXON UBAYDULLAYEV TUIT 27 ноя 2012 12:44
I think this is incorrect test. Because, No three towns lay on one line.