vj1118 统计单词个数

Vj1118 统计单词个数

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

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //dp //Éè f[i,k] Ϊǰ i ¸ö×Öĸ»®·Ö³É k ²¿·ÖµÄ×î´óµ¥´ÊÊý //f[i,k] = max ( f[j,k-1]+sum[j+1,i]) //Ô¤´¦Àí sum[j+1,i] ֮ǰ ÏÈ°Ñÿ¸ö×ÖĸÍùºóµÄ×îС³¤¶ÈÆ¥Åäµ¥´Ê¼Ç¼ÏÂÀ´¿ÉÒÔ½µÒ»Î¬ //ÒòΪƥÅäÄĸö¶¼¿ÉÒÔ µ«ÒªÔÚÇø¼ä j+1¡«i ÄÚ ËùÒÔÒªÕÒ³¤¶È×îСµÄ len[j+1~i] / const maxs=6; maxk=40; maxn=200; var n,p,m,tot:integer; s:string; words:array[0. .maxs] of string; len:array[0. .maxn] of string; f:array[0. .maxn,0. .maxk] of integer; sum:array[0. .maxn,0. .maxn] of integer; procedure init; var i:integer; st:string; begin readln(p,m); for i:=1 to p do begin inc(n,20);
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

Vj1118 统计单词个数

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