ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1178. Akbardin’s Roads

Who can help me?Write to this address:yuyuanming163@163.com
Posted by Tony 30 Sep 2002 15:46
Re: I have got AC!!!
Posted by Tony 30 Sep 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!
Posted by Vlad Veselov 30 Apr 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. "
Posted by Vlad Veselov 30 Apr 2004 22:35
Re: I have got AC!!!
Posted by nickolas stoudemire 25 Aug 2007 10:28
Your solution looks so strange!
Can you tell me why it works?
Re: I have got AC!!!
Posted by nickolas stoudemire 25 Aug 2007 10:31
Ha!
Very funny!
I got it!
Oh, yeah!!!!!!!!!!!!!
Re: I have got AC!!!
Posted by nickolas stoudemire 25 Aug 2007 10:32
Oh, you needn't explain it to me any more.
I have understood it!
Re: I have got AC!!!
Posted by Enigma [UB of TUIT] 21 Oct 2011 14:33
bravoooo!!! Your idea is very good.
Re: But your solution is wrong!
Posted by AYUBXON UBAYDULLAYEV TUIT 27 Nov 2012 12:44
I think this is incorrect test. Because, No three towns lay on one line.