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

Can anybody help me with an idea for this problem?
Posted by bleah 9 Sep 2002 16:45

 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 ...
Re: Can anybody help me with an idea for this problem?
Posted by Locomotive 9 Jan 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.


!!!!
Re: Can anybody help me with an idea for this problem?
Posted by TheDreamCatcher 13 Dec 2010 09:11
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
Re: Can anybody help me with an idea for this problem?
Posted by sbidujko 6 Sep 2011 17:41
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