vj1218 &aelig;•&deg;&aring;&shy;—&aelig;&cedil;&cedil;&aelig;ˆ

# Vj1218 æ•°å­—æ¸¸æˆ

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

//±ÉÈËµÄ·½·¨ //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;

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

View Full Document
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
Ask a homework question - tutors are online