Search found 9 matches

by nayaya
Mon Aug 11, 2003 6:28 am
Forum: Volume 104 (10400-10499)
Topic: 10453 - Make Palindrome
Replies: 38
Views: 15198

Noim, I don't quite understand how your alg works. I used Dynamic Programming to calculate Min [j], which means the minimum number of chars to be added between position i and j in order to make this substring(between i and j) a palindrom. It has nothing to do with LCS. How do you think about it? I g...
by nayaya
Fri Aug 09, 2002 10:34 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 38100

I think your size of the two arrays should be much much bigger. I got the same reply on 202, and I got AC after I enlarged the array. Try!
by nayaya
Fri Aug 09, 2002 10:28 am
Forum: Volume 4 (400-499)
Topic: 497 - Strategic Defense Initiative
Replies: 144
Views: 20942

Thank you. Now I have corrected and got AC.
by nayaya
Fri Aug 09, 2002 3:11 am
Forum: Volume 4 (400-499)
Topic: 497 - Strategic Defense Initiative
Replies: 144
Views: 20942

Still WA! Why?

program p497(input,output); type sss=array[1..2000] of integer; var a,b,h,x:sss; i,j,max1,max2,max,n,s,k:integer; procedure work; begin n:=n+1; readln(h[n]); b[n]:=0; max1:=0;max2:=0; for i:=1 to n-1 do if (a >max1) and (h[n]>h ) then begin max1:=a ; max2:=i; end; a[n]:=max1+1; b[n]:=max2; if a[n]>m...
by nayaya
Thu Aug 08, 2002 5:44 pm
Forum: Volume 4 (400-499)
Topic: 497 - Strategic Defense Initiative
Replies: 144
Views: 20942

497:Why WA?Please help me

:( [pascal] program p497(input,output); type sss=array[1..2000] of integer; var a,b,h,x:sss; i,j,max1,max2,max,n,s,k:integer; procedure work; begin n:=n+1; readln(h[n]); b[n]:=0; max1:=0;max2:=0; for i:=1 to n-1 do if (a >max1) and (h[n]>h ) then begin max1:=a ; max2:=i; end; a[n]:=max1+1; b[n]:=max...
by nayaya
Thu Jul 25, 2002 3:14 am
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 20934

Thank you. Now I know what was the problem. And I've got AC.
by nayaya
Sat Jul 13, 2002 6:46 am
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 20934

147 Why WA?

[pascal] program p147(input,output); type aaa=array[1..1000,1..10] of longint; sss=array[1..10] of integer; var r:real; ans:aaa; a:sss; i,n,k,j:integer; m:longint; procedure findans; var s:longint; begin a[1]:=1;a[2]:=2;a[3]:=4;a[4]:=10;a[5]:=20;a[6]:=40;a[7]:=100; a[8]:=200;a[9]:=400;a[10]:=1000; f...
by nayaya
Sat Jun 08, 2002 2:18 pm
Forum: Volume 2 (200-299)
Topic: 202 - Repeating Decimals
Replies: 82
Views: 10788

xenon wrote:your arrays are too small. the program tries to access elements outside the range [0..100].
Thank you. But I tried [0..200] and nothing changed, still Invalid memory reference.
by nayaya
Sat Jun 08, 2002 2:03 pm
Forum: Volume 2 (200-299)
Topic: 202 - Repeating Decimals
Replies: 82
Views: 10788

202 - Repeating Decimals

Why do I always get a Runtime Error? Always Invalid memory reference? What' wrong with my pascal program? [pascal] program p202(input,output) type sss=array[0..100] of integer; var n,d,k,i,m:integer; left,num:sss; tf:boolean; procedure work; begin num[0]:=n div d; left[0]:=n mod d; k:=0;tf:=true; w...

Go to advanced search