// HSP
#module
#defcfunc min int a, int b
if a<b : return a
return b
#defcfunc strcnv var sw, str ss, local len
sdim sw, (strlen(ss)+1)*2
cnvstow sw, ss
repeat
if wpeek(sw, len*2)=0 : break
len++
loop
return len
#defcfunc levenshtein str a_, str b_, \
local a, local b, local a_len, local b_len, local cost, local x, local y
a_len=strcnv(a, a_)
b_len=strcnv(b, b_)
dim cost, a_len+1, b_len+1
repeat a_len+1 : cost(cnt, 0)=cnt : loop
repeat b_len+1 : cost(0, cnt)=cnt : loop
for y, 1, b_len+1
for x, 1, a_len+1
change_cost=(wpeek(a, (x-1)*2)!wpeek(b, (y-1)*2))*2
cost(x, y)=min(min(cost(x-1, y)+1, cost(x, y-1)+1), cost(x-1, y-1)+change_cost)
next
next
return cost(a_len, b_len)
#global
key="プログラミングのお題スレ"
list.0="推薦図書/必読書のためのスレッド 71"
list.1="Windowsストアアプリ開発について語れ"
list.2="C#,C#の宿題片付けます。"
list.3="C言語なら俺に聞け(入門編)Part 123"
list.4="バージョン管理システムについて語るスレ9"
list.5="プログラミングの問題を出すスレ"
list.6="C++相談室 part108"
list.7="プログラミングのお題 Part2"
list.8="C言語なら俺に聞け(入門編)Part 122"
list.9="VBScriptについて必死に話し合うスレ"
list.10="Lisp Scheme Part37"
list.11="構造化ウェブプログラミング言語Dart2"
for i, 0, length(list)
for j, 1, length(list)-i
if levenshtein(list(j-1), key)>levenshtein(list(j), key) {
t=list(j-1)
list(j-1)=list(j)
list(j)=t
}
next
next
foreach list
mes list.cnt
loop
Ly8gSFNQCiNtb2R1bGUKI2RlZmNmdW5jIG1pbiBpbnQgYSwgaW50IGIKCWlmIGE8YiA6IHJldHVybiBhCglyZXR1cm4gYgoKI2RlZmNmdW5jIHN0cmNudiB2YXIgc3csIHN0ciBzcywgbG9jYWwgbGVuCglzZGltIHN3LCAoc3RybGVuKHNzKSsxKSoyCgljbnZzdG93IHN3LCBzcwoJcmVwZWF0CgkJaWYgd3BlZWsoc3csIGxlbioyKT0wIDogYnJl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