基本算法 这些都是非常基本的的算法,希望所有学习的人都能理解! 1.数论算法 求两数的最大公约数 function gcd(a,b:integer):integer; begin if b=0 then gcd:=a else gcd:=gcd (b,a mod b); end ; 求两数的最小公倍数 function lcm(a,b:integer):integer; beg…
Letter GameIOI 1995 Figure 1: Each of the 26 lowercase letters and its value Letter games are popular at home and on television. In one version of the game, every letter has a value, and you collect letters to form one or more words giving the highes…
Your Ride Is Here It is a well-known fact that behind every good comet is a UFO. These UFOs often come to collect loyal supporters from here on Earth. Unfortunately, they only have room to pick up one group of followers on each trip. They do, however…