vj1099 虫食算

vj1099...

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

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //dfs //´ÓµÍλµ½¸ßλö¾Ùÿ¸öûȷ¶¨µÄ×Öĸ //¼ôÖ¦1£ººÍ²»È·¶¨Ôò¸ù¾Ý¼ÓÊýËã³öºÍ ºÍÈ·¶¨ÔòÅжÏ(¼ÓÊý+½øλ) mod n ÊÇ·ñµÈÓÚºÍ //¼ôÖ¦2£º×î¸ßλÁ½¼ÓÊýÈ·¶¨ÇÒÓнøλ Ôò¼ôÖ¦ //¼ôÖ¦3£ºÈç¹ûÇ° k-1 λ ÖÐijλÁ½¼ÓÊý(a,b)ÒÑÖª ´ËʱÈç¹ûºÍ(c)Ò²ÒÑÖª ½øλ×î¶àΪ 1 Ôò(a+b) mod n<>c & (a+b+1) mod n<>c Ôò¼ôÖ¦ //Èç¹ûºÍδ֪ ÔòºÍ±ØΪ (a+b) mod n | (a+b+1) mod n Èç¹ûÕâÁ½¸ö¶¼ÓùýÁË Ôò¼ôÖ¦ Ô //ÁíÍâ µ¹×Åö¾Ù×îÊÊÒ˱¾ÌâÊý¾Ý µ«Ëæ»úö¾Ù¸üÊʺÏÒ»°ãÇé¿ö / const maxn=26; var n:integer; s:array[1. .3] of string[maxn]; num:array['A'. .'Z'] of integer; v:array[0. .maxn] of boolean; procedure init; var i:char; begin readln(n); readln(s[1]); readln(s[2]); readln(s[3]); for i:='A' to chr(ord(65+n-1)) do num[i]:=-1; randomize; end; procedure print;
Background image of page 1

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

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

Page1 / 2

vj1099...

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