Общий форумDinh Hong Minh has just repaired 2 problems ( 1074,1097 ) for you : - 1074 + when s='', you call s[1] = '-' --> crash; + Use {$R+} in the begining of source code to solved other error.
- 1097 + The initialize value of Max is 1, you use 0 --- --> wrong answer. + Your algo is too slow, you must change it. @ Good luck !!! PS : Can you tell him the way to solve 1018 ? Mail to : dinhhongminh@yahoo.com Dinh Hong Minh has just repaired 2 problems ( 1074,1097 ) for you : - 1074 + when s='', you call s[1] = '-' --> crash; + Use {$R+} in the begining of source code to solved other error.
- 1097 + The initialize value of Max is 1, you use 0 --- --> wrong answer. + Your algo is too slow, you must change it. @ Good luck !!! PS : Can you tell him the way to solve 1018 ? Mail to : dinhhongminh@yahoo.com Dinh Hong Minh has just repaired 2 problems ( 1074,1097 ) for you : - 1074 + when s='', you call s[1] = '-' --> crash; + Use {$R+} in the begining of source code to solved other error.
- 1097 + The initialize value of Max is 1, you use 0 --- --> wrong answer. + Your algo is too slow, you must change it. @ Good luck !!! PS : Can you tell him the way to solve 1018 ? Mail to : dinhhongminh@yahoo.com Dinh Hong Minh has just repaired 2 problems ( 1074,1097 ) for you : - 1074 + when s='', you call s[1] = '-' --> crash; + Use {$R+} in the begining of source code to solved other error.
- 1097 + The initialize value of Max is 1, you use 0 --- --> wrong answer. + Your algo is too slow, you must change it. @ Good luck !!! PS : Can you tell him the way to solve 1018 ? Mail to : dinhhongminh@yahoo.com Dinh Hong Minh has just repaired 2 problems ( 1074,1097 ) for you : - 1074 + when s='', you call s[1] = '-' --> crash; + Use {$R+} in the begining of source code to solved other error.
- 1097 + The initialize value of Max is 1, you use 0 --- --> wrong answer. + Your algo is too slow, you must change it. @ Good luck !!! PS : Can you tell him the way to solve 1018 ? Mail to : dinhhongminh@yahoo.com Dinh Hong Minh has just repaired 2 problems ( 1074,1097 ) for you : - 1074 + when s='', you call s[1] = '-' --> crash; + Use {$R+} in the begining of source code to solved other error.
- 1097 + The initialize value of Max is 1, you use 0 --- --> wrong answer. + Your algo is too slow, you must change it. @ Good luck !!! PS : Can you tell him the way to solve 1018 ? Mail to : dinhhongminh@yahoo.com > Vietnam'll try hard next year. But this year is not bad. I think so. Oh i found out a genius in IOI2001. He is Reid Barton. Four gold medals IMO and two gold medals IOI ?!! In two past centuries ago, we fell down, but in this twenty first century, we will find the magnanimous time long ago. Enter TOP 3 countries in the world is our object this century. Although our intelligence is the best , I think this object is difficult. Here is my program. If you can find what's wrong with it - help meprogram staircase; const max=60; var n,i,j:longint; a:array[0..max,0..max]of real; procedure br(n:integer); var i,j:integer; begin for i:=1 to n do for j:=1 to n do if j=1 then a[i,j]:=0 else if (j*(j+1)div 2)<i then a[i,j]:=0 else if j=i then a[i,j]:=1+a[j,j-1] else if (j=i-1)then a[i,j]:=1+a[i,j-1] else if j>i then a[i,j]:=a[i,i] else a[i,j]:=a[i-j,j-1]+a[i,j-1]; end; begin readln(n); br(n); writeln(round(a[n,n]-1)); end. Thanks! Please, help to me with the staircase - problem 1017 It always gives mi "Acces Violation Crash". Why? > Please, help to me with the staircase - problem 1017 > It always gives mi "Acces Violation Crash". Why? Maybe you generated a "Range Check Error" or something like that. > > Please, help to me with the staircase - problem 1017 > > It always gives mi "Acces Violation Crash". Why? > Maybe you generated a "Range Check Error" or something like > that. Here is my program. Have a look at it and if you can - help meprogram staircase; const max=60; var n,i,j:longint; a:array[0..max,0..max]of real; procedure br(n:integer); var i,j:integer; begin for i:=1 to n do for j:=1 to n do if j=1 then a[i,j]:=0 else if (j*(j+1)div 2)<i then a[i,j]:=0 else if j=i then a[i,j]:=1+a[j,j-1] else if (j=i-1)then a[i,j]:=1+a[i,j-1] else if j>i then a[i,j]:=a[i,i] else a[i,j]:=a[i-j,j-1]+a[i,j-1]; end; begin readln(n); br(n); writeln(round(a[n,n]-1)); end. program Timus_1003; const MaxQAs=5000; EndFlag=-1; type TQA= record First,Last:LongInt; Answer:Boolean; end; var nQAs,X:LongInt; QAs:array [1..MaxQAs] of TQA; function InputData:Boolean; var i,Len:LongInt; Temp:string; begin ReadLn(Len); if Len=EndFlag then begin InputData:=False; Exit; end; ReadLn(nQAs); for i:=1 to nQAs do with QAs[i] do begin ReadLn(First,Last,Temp); while Temp[1]=' ' do Delete(Temp,1,1); Answer:=Temp='odd'; end; InputData:=True; end; procedure Solve; var i,nItems:LongInt; Items:array [1..MaxQAs] of TQA; function Insert(QA:TQA):Boolean; var i,MaxLast,MinLast:LongInt; MaxAnswer,MinAnswer:Boolean; Item:TQA; function FindItem(First:LongInt):LongInt; var i,j,k:LongInt; begin i:=1; j:=nItems; repeat k:=(i+j) div 2; if Items[k].First=First then begin FindItem:=k; Exit; end else if Items[k].First>First then j:=k-1 else i:=k+1; until i>j; FindItem:=0; end; procedure InsertItem(Item:TQA); var i,j:LongInt; begin for i:=1 to nItems do if Items[i].First>Item.First then begin for j:=nItems downto i do Items[j+1]:=Items[j]; Inc(nItems); Items[i]:=Item; Exit; end; Inc(nItems); Items[nItems]:=Item; end; function Subtract(A,B:Boolean):Boolean; begin Subtract:=A xor B; end; begin repeat i:=FindItem(QA.First); if i=0 then begin InsertItem(QA); Insert:=True; Exit; end else if Items[i].Last=QA.Last then begin Insert:=Items[i].Answer=QA.Answer; Exit; end else begin if Items[i].Last>QA.Last then begin MaxLast:=Items[i].Last; MinLast:=QA.Last; MaxAnswer:=Items[i].Answer; MinAnswer:=QA.Answer; end else begin MaxLast:=QA.Last; MinLast:=Items[i].Last; MaxAnswer:=QA.Answer; MinAnswer:=Items[i].Answer; end; with Items[i] do begin Last:=MinLast; Answer:=MinAnswer; end; with Item do begin First:=MinLast+1; Last:=MaxLast; Answer:=Subtract(MaxAnswer,MinAnswer); end; QA:=Item; end; until False; end; begin nItems:=0; FillChar(Items,SizeOf(Items),0); for i:=1 to nQAs do if not Insert(QAs[i]) then begin X:=i-1; Exit; end; X:=nQAs; end; procedure Print; begin WriteLn(X:0); end; begin while InputData do begin Solve; Print; end; end. > program Timus_1003; > const > MaxQAs=5000; > EndFlag=-1; > type > TQA= > record > First,Last:LongInt; > Answer:Boolean; > end; > var > nQAs,X:LongInt; > QAs:array [1..MaxQAs] of TQA; > function InputData:Boolean; > var > i,Len:LongInt; > Temp:string; > begin > ReadLn(Len); > if Len=EndFlag then > begin > InputData:=False; > Exit; > end; > ReadLn(nQAs); > for i:=1 to nQAs do > with QAs[i] do > begin > ReadLn(First,Last,Temp); > while Temp[1]=' ' do > Delete(Temp,1,1); > Answer:=Temp='odd'; > end; > InputData:=True; > end; > procedure Solve; > var > i,nItems:LongInt; > Items:array [1..MaxQAs] of TQA; > function Insert(QA:TQA):Boolean; > var > i,MaxLast,MinLast:LongInt; > MaxAnswer,MinAnswer:Boolean; > Item:TQA; > function FindItem(First:LongInt):LongInt; > var > i,j,k:LongInt; > begin > i:=1; > j:=nItems; > repeat > k:=(i+j) div 2; > if Items[k].First=First then > begin > FindItem:=k; > Exit; > end > else > if Items[k].First>First then > j:=k-1 > else > i:=k+1; > until i>j; > FindItem:=0; > end; > procedure InsertItem(Item:TQA); > var > i,j:LongInt; > begin > for i:=1 to nItems do > if Items[i].First>Item.First then > begin > for j:=nItems downto i do > Items[j+1]:=Items[j]; > Inc(nItems); > Items[i]:=Item; > Exit; > end; > Inc(nItems); > Items[nItems]:=Item; > end; > function Subtract(A,B:Boolean):Boolean; > begin > Subtract:=A xor B; > end; > begin > repeat > i:=FindItem(QA.First); > if i=0 then > begin > InsertItem(QA); > Insert:=True; > Exit; > end > else > if Items[i].Last=QA.Last then > begin > Insert:=Items[i].Answer=QA.Answer; > Exit; > end > else > begin > if Items[i].Last>QA.Last then > begin > MaxLast:=Items[i].Last; > MinLast:=QA.Last; > MaxAnswer:=Items[i].Answer; > MinAnswer:=QA.Answer; > end > else > begin > MaxLast:=QA.Last; > MinLast:=Items[i].Last; > MaxAnswer:=QA.Answer; > MinAnswer:=Items[i].Answer; > end; > with Items[i] do > begin > Last:=MinLast; > Answer:=MinAnswer; > end; > with Item do > begin > First:=MinLast+1; > Last:=MaxLast; > Answer:=Subtract(MaxAnswer,MinAnswer); > end; > QA:=Item; > end; > until False; > end; > begin > nItems:=0; > FillChar(Items,SizeOf(Items),0); > for i:=1 to nQAs do > if not Insert(QAs[i]) then > begin > X:=i-1; > Exit; > end; > X:=nQAs; > end; > procedure Print; > begin > WriteLn(X:0); > end; > begin > while InputData do > begin > Solve; > Print; > end; > end. > Type Arr = record X,Y : Integer; P : Byte; L : Integer; End; Var N,L,M : Integer; Land : Array[1..100] of Arr; S1,S2 : Array[1..200] of Integer; Total1,Total2 : Integer; Procedure Init; Var i,j : Integer; Begin Readln(N,L); Readln(M); For i := 1 to M do Readln(Land[i].P,Land[i].L,Land[i].X,Land[i].Y); End; Procedure Main; Var i,j,k : Integer; T : Arr; T2 : Integer; Max : Byte; Min : Byte; Yes : Boolean; Begin Min := 255; For i := 1 to N-L do For j := 1 to N-L do Begin Max := 0; For k := 1 to M do If (i+L<=Land[k].X) or (i>=Land[k].X+Land[k].L) or (j+L<=Land[k].Y) or (j>=Land[k].Y+Land[k].L) then Continue else If Land[K].P>Max then Begin Max := Land[K].P; If Max>Min then Break; End; If Max<Min then Begin Min := Max; End; End; If Min<=100 then Writeln(Min) else Writeln('IMPOSSIBLE'); End; Begin Init; Main; End. > Type Arr = record > X,Y : Integer; > P : Byte; > L : Integer; > End; > Var N,L,M : Integer; > Land : Array[1..100] of Arr; > S1,S2 : Array[1..200] of Integer; > Total1,Total2 : Integer; > > Procedure Init; > Var i,j : Integer; > Begin > Readln(N,L); > Readln(M); > For i := 1 to M do > Readln(Land[i].P,Land[i].L,Land[i].X,Land[i].Y); > End; > > Procedure Main; > Var i,j,k : Integer; > T : Arr; > T2 : Integer; > Max : Byte; > Min : Byte; > Yes : Boolean; > Begin > Min := 255; > For i := 1 to N-L do > For j := 1 to N-L do > Begin > Max := 0; > For k := 1 to M do > If (i+L<=Land[k].X) or (i>=Land[k].X+Land[k].L) or > (j+L<=Land[k].Y) or (j>=Land[k].Y+Land[k].L) > then Continue > else If Land[K].P>Max then > Begin > Max := Land[K].P; > If Max>Min then Break; > End; > If Max<Min then > Begin > Min := Max; > End; > End; > If Min<=100 then Writeln(Min) > else Writeln('IMPOSSIBLE'); > End; > > Begin > Init; > Main; > End. > > Type Arr = record > > X,Y : Integer; > > P : Byte; > > L : Integer; > > End; > > Var N,L,M : Integer; > > Land : Array[1..100] of Arr; > > S1,S2 : Array[1..200] of > Integer; > > Total1,Total2 : Integer; > > > > Procedure Init; > > Var i,j : Integer; > > Begin > > Readln(N,L); > > Readln(M); > > For i := 1 to M do > > Readln(Land[i].P,Land[i].L,Land[i].X,Land[i].Y); > > End; > > > > Procedure Main; > > Var i,j,k : Integer; > > T : Arr; > > T2 : Integer; > > Max : Byte; > > Min : Byte; > > Yes : Boolean; > > Begin > > Min := 255; > > For i := 1 to N-L do > > For j := 1 to N-L do > > Begin > > Max := 0; > > For k := 1 to M do > > If (i+L<=Land[k].X) or (i>=Land[k].X+Land [k].L) > or > > (j+L<=Land[k].Y) or (j>=Land[k].Y+Land [k].L) > > then Continue > > else If Land[K].P>Max then > > Begin > > Max := Land[K].P; > > If Max>Min then Break; > > End; > > If Max<Min then > > Begin > > Min := Max; > > End; > > End; > > If Min<=100 then Writeln(Min) > > else Writeln('IMPOSSIBLE'); > > End; > > > > Begin > > Init; > > Main; > > End. Just think a little ! This Prob is as easy as Prob 1000. It has one important point. 71222119 mailto : trungduck@yahoo.com > > Oh, may be this comparision is not right but I think this prob is a bit the same 1104 (and as easy as this). Is that right brother QH ? 71222119 mailto : trunduck@yahoo.com > > What does 71222119 mean? Do you see : letter T looks like digit 7 letter R looks like digit 12 letter U looks like digit 22 letter N looks like digit 11 letter G looks like digit 9 so 71222119 = TRUNG = My name. 71222119 mailto : trungduck@yahoo.com > What does 71222119 mean? Can you understand Chinese? Sorry, I can't. But why do you ask me so ? 71222119 mailto : trungduck@yahoo.com > Can you understand Chinese? > Sorry, I can't. But why do you ask me so ? > 71222119 > mailto : trungduck@yahoo.com > > > Can you understand Chinese? Do you know what the other meaning of my name in chinese is, brother Hiep beo ? Tell me, pls ! 71222119 mailto trungduck@yahoo.com > > Sorry, I can't. But why do you ask me so ? > > 71222119 > > mailto : trungduck@yahoo.com > > > > > Can you understand Chinese? > QH@ Ua bai nay ma giam duoc time co a ? Em nghi lam gi co cach nao ? 71222119 mailto : trungduck@yahoo.com > QH@ > Ua bai nay ma giam duoc time co a ? Em nghi lam gi co cach > nao ? > 71222119 > mailto : trungduck@yahoo.com > > QH@ Do you know who Lintao850711 is ? I want to contact him. Thanks. Could you please tell me where I can get IOI2001 Tasks (exactly addressed) ! Thanks. 71222119 mailto : trungduck@yahoo.com I have just repaired 2 problems ( 1074,1097 ) for you : - 1074 + when s='', you call s[1] = '-' --> crash; + Use {$R+} in the begining of source code to solved other error.
- 1097 + The initialize value of Max is 1, you use 0 --- --> wrong answer. + Your algo is too slow, you must change it. @ Good luck !!! PS : Can you tell me the way to solve 1018 ? Mail to : dinhhongminh@yahoo.com Please warn the authors when the server is going down . . . And when is it supposed to be up again ! What are the reasons for this ? Whenever I decide to solve problems here instead of acm.uva.es the submit porblem page just does not work ("/submit.asp, line 37") ! G.Tsankov > Noway, it is impossible :))) |
|