|
|
вернуться в форумCan anybody help me with an idea for this problem? Послано bleah 9 сен 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? > > 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? > > 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? 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 |
|
|