vj1218 数字游戏

Vj1218 数字游戏

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

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //DP //¶ÔÓÚ»·ÐÍ¿ÉÒÔÏÈö¾Ù¶Ï¿ªÎ»Öà ȻºóÔÙ¶Ô n ¸öÊý½øÐÐ DP //Éè f[i,k] Ϊǰ i ¸öÊý·Ö³É k ¸ö²¿·ÖµÄ×î´ó³Ë»ý //f[i,k]=f[j,k-1]*(sum[j+1,i] mod 10 + 10 ) mod 10 / //×¢Ò⸺ÊýÈ¡ÓàÔËËãΪ (a mod b + b) mod b / const maxm=9; maxn=50; var n,m:integer; a1,a2:longint; a,sum:array[0. .2*maxn] of integer; g,f:array[0. .maxn,0. .maxm] of longint; function min(x,y:longint):longint; begin if x<=y then exit(x); exit(y); end; function max(x,y:longint):longint; begin if x>=y then exit(x); exit(y); end; procedure init; var i:integer; begin readln(n,m); for i:=1 to n do begin read(a[i]); a[i+n]:=a[i]; end; end; procedure main; var i,j,k,l:integer; begin for i:=1 to n << 1 -1 do sum[i]:=(sum[i-1]+a[i]) mod 10;
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.

This note was uploaded on 02/21/2011 for the course CS 001 taught by Professor 001 during the Spring '11 term at Shandong University.

Page1 / 2

Vj1218 数字游戏

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