vj1028 魔族密码

Vj1028 魔族密码

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //trie / const maxn=2000*75; var n,ans,nodes:longint; s:string[75]; next:array[0. .maxn,'a'. .'z'] of longint; v:array[0. .maxn,'a'. .'z'] of boolean; procedure main; var i,j,k,tot:longint; begin readln(n); for i:=1 to n do begin readln(s); j:=1; k:=0; tot:=1; while (j<=length(s)) and (next[k,s[j]]>0) do begin
Background image of page 1
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.

Ask a homework question - tutors are online