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 1107. Warehouse Problem


 If there whould be no cicles then a topological sort would do the
job but I can't figure out how to solve the problem ...
>
>  If there whould be no cicles then a topological sort would do the
> job but I can't figure out how to solve the problem ...

look@ mine:


Var
  i,k,t               :word;
begin
  readln(i,k,t);
  writeln('YES');
  for i:=1 to k do
  begin
    readln(t);
    writeln(2-(t mod 2));
  end;
end.


!!!!
Locomotive wrote 9 January 2003 00:46
>
>  If there whould be no cicles then a topological sort would do the
> job but I can't figure out how to solve the problem ...

look@ mine:


Var
  i,k,t               :word;
begin
  readln(i,k,t);
  writeln('YES');
  for i:=1 to k do
  begin
    readln(t);
    writeln(2-(t mod 2));
  end;
end.


!!!!

It's stupid text... get WA1 & Locomotive didn't get AC
There is very simple idea how distribute all K sets to these M shops.It can to do in one line of code, very important that N<M! (Of course, answer YES always)

Edited by author 06.09.2011 17:53