Common Board(0<=W,D<=1000) (0<x0<W, 0<y0<D) (0<x1<W, 0<y1<D) if w and d are 0 then no x or y can be taken. My algo is O(n). Reading and checking in one loop. With out stack, queue, array or recursion. It is really? Sorry, I don't speak English. This is a stupid trick, since q = 0 is not considered positive. Hope it saves a few minutes of your life. Oh, thanks man! It would take me years to guess! Thanks Dan Stefan. I must be more attentively for statement of a problem Thank you thank you very much! this case wasted me 10^n minutes... 太不好了!底些! <the line above, Chinese, which you can ignore it.> Thank you man! You saved my life :) thank you! :) I think that integers must be > 0, but there stay 0<=N<=... Edited by author 21.04.2008 20:58 Edited by author 21.04.2008 20:59 >>4 >>9 9 1 9 <<1 >>20 >>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 <<378 >>7 >>1 2 3 4 5 6 7 <<11 In this problem we want to minimize the total time needed for all workers as if they run to the shelters one by one. I think this is illogical as in case of a bombardment all workers will run to the shelters simultaneously. Noone else can run until documents are checked at the destination. I think yes, but it's not clear from problem statement despite the name of this set. In russian it is said: "Правильной выпуклой оболочкой множества M называется минимальное по включению выпуклое множество.." I think that english statement is wrong.. Here is my code!!! Please help me!!! What my mistake? Const stroka='friend'; TYpe lmas=array[1..5000]of string; VAR n :integer; fr :array[1..100]of string; a,b,c :array[1..100]of lmas; d,g,h :array[0..100]of integer; Procedure INIT; var i,j,p :integer; ch :char; s,s1 :string; begin readln(n); for i:=1 to n do begin readln(fr[i]); readln(s); j:=0; s1:=''; while s<>'</blog>' do begin s1:=copy(s,pos('<',s)+1,6); while s1=stroka do begin p:=pos('<',s); if stroka=s1 then begin delete(s,pos('<',s),8); if copy(s,p,pos('<',s)-p)<>fr[i] then begin inc(j); a[i,j]:=copy(s,p,pos('<',s)-p); end; end; s1:=copy(s,pos('<',s)+1,6); end; s1:=''; for p:=length(s) downto 1 do if s[p]<>' ' then begin s1:=s[p]+s1; if s1='</blog>' then begin s:=''; break; end else if length(s1)>7 then break; end; if s='' then break; readln(s); end; d[i]:=j; end; end; Function FRIEND(x,y:integer):integer; var i :integer; begin FRIEND:=0; for i:=1 to n do if x<>i then if fr[i]=a[x,y] then begin FRIEND:=i; exit end; end; Function OK(x,y:integer):boolean; var i,j :integer; begin i:=FRIEND(x,y); OK:=FALSE; for j:=1 to d[i] do if a[i,j]=fr[x] then begin OK:=TRUE; exit end; end; Procedure SORT(var s:lmas;n:integer); var i,j :integer; k :string; begin for j:=1 to n-1 do for i:=1 to n-j do if s[i]>s[i+1] then begin k:=s[i]; s[i]:=s[i+1]; s[i+1]:=k; end; end; Procedure SOLVE; var i,j,p :integer; begin for i:=1 to n do for j:=1 to d[i] do begin p:=FRIEND(i,j); inc(g[p]); b[p,g[p]]:=fr[i]; end; for i:=1 to n do for j:=1 to d[i] do if OK(i,j) then begin inc(h[i]); c[i,h[i]]:=a[i,j]; end; for i:=1 to n do SORT(a[i],d[i]); for i:=1 to n do SORT(b[i],g[i]); for i:=1 to n do SORT(c[i],h[i]); end; Procedure OUT; var i,j :integer; begin for i:=1 to n do begin writeln(fr[i]); write('1: '); j:=1; while j<d[i] do begin write(a[i,j],', '); inc(j); end; if a[i,j]<>'' then writeln(a[i,j]) else writeln; write('2: '); j:=1; while j<g[i] do begin write(b[i,j],', '); inc(j); end; if b[i,j]<>'' then writeln(b[i,j]) else writeln; write('3: '); j:=1; while j<h[i] do begin write(c[i,j],', '); inc(j); end; if c[i,j]<>'' then writeln(c[i,j]) else writeln; writeln; end; end; BEGIN INIT; SOLVE; OUT; END. I have wa17 when I had some dublicate names in array of friends. When I got "outpoot limit exceeded" at the first time, I add check when number of chars writed >100000 then programs must terminate. But that program got OLE again( What reason? I really don't understand. Maybe bug in checker? I think OLE is outer to checker in judge system and has fixed limit for all problems. Can you tell me if the required "well" convex hull can have points not from the set M? Thank you. Yes, and generally it will Well-formed convex hull of set M is minimal (relative to inclusion) set, containing M Minimal area Edited by author 03.08.2008 16:55 Please look at the problem statement! I (and some other people at the webboard) think that in description of walls the words "...the pair of numbers M and N define..." should be changed to "...the pair of numbers N and M define..." - M and N should be swapped both in description of horisontal and vertical walls. I also got WA at test 2 first. But when I swapped N and M - I got AC! It's XY order EVERYWHERE. X defines column, Y defines row. Edited by author 03.08.2008 16:49 3 2 1 1 1 2 h 2 1 answer is "No solution" Wrong Edited by author 12.04.2008 11:19 Right. It's "No solution" Maybe there is a special case that is not mentioned in the problem or I didn't understand... Can you give some tests? I didn't work on any of special cases. There is a good test - points that are close on the surface will be pretty close in 3D space. Otherwise you've flipped something. Also check boundary cases, especially on the edge of the envelope. I watched all cases wich was here plus my own. THEY ARE ALL TRUE! Please help me, give me some extra extra extra test, PLZ!!! Edited by author 18.12.2007 10:29 1 1 1 1 10 10 100 Correct answer: 0.00 0.00 If you crash on test3............. Don't forgot that n may be 1 or 2.It is possible! in prog if input 1 1.1 0 0 output 6.91 but when i calculate on my own i got answer=6.90 Don't forgot that n may be also 0. It is also possible. What is the answer if n=0?? Thanks in advance!!~~~ who can give your code to me ? if you used suffix arry or suffix tree The best used c language email: k13795263@126.com Edited by author 02.08.2008 17:58 Aidin_n7@hotmail.com I don't understand a problem Why the answer to sample input 1 is "YES" ? If we take i = 2 and j = 3, then (3+0)<>(3-2+1)+3 (3+0)<=(3-2+1)+3 Yes, just 373K and it's AC. Check that it's a sequence. very nice problem !!! jus a bit of thinking reqd Nice - i agree. For others only 10 strings - AC - 0.015 Nice - i agree. For others only 10 strings - AC - 0.015 |
|