vj1143 三取方格数

Vj1143 三取方格数

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //¶à½ø³Ì dp //Éè f[ x1 , x2 , x3 , step ] ΪÈý¸öÈ˺á×ø±ê·Ö±ðΪ x1 , x2 , x3 ÿ¸öÈ˶¼×ßÁË step µÄ×îÓÅÈ¡ÖµÇé¿ö //ÒòΪ֪µÀÁË step ºÍ x ËùÒÔ¿ÉÒÔËã³öËûÃÇµÄ y ÕâÈý¸öµãÿ¸öµã¶¼ÓÐÁ½ÖÖÇé¿öתÒÆÀ´ Èý¸öµã¹² 8 ÖÖ×éºÏÇé¿ö //f[x1,x2,x3,step]=f[ x1+d[i] , x2+d[j] , x3+d[k] , step-1 ] + sum sumΪÈý¸öÈ˵±Ç°Ò»²½È¡µÃµÄ×ÜºÍ s const maxn=40; d:array[1. .2] of integer=(0,-1); var n:integer; g:array[0. .maxn,0. .maxn] of integer; f:array[0. .maxn,0. .maxn,0. .maxn,0. .2*maxn] of integer; procedure init; var i,j:integer; begin readln(n); for i:=1 to n do for j:=1 to n do read(g[i,j]); end; procedure main; var
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Vj1143 三取方格数

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online