Algorithm11

Size: px
Start display at page:

Download "Algorithm11"

Transcription

1 4 I 11 vr = mke_tble() fuctio serch(s){ m = [h(s)] if (m === udefied) puts(s + " is udefied") else puts(m) serch("") serch("foo") foo is udefied JvScript == === 1 h 345 fuctio delete_elemet(s){ vr vl = [h(s)] if (vl === udefied) puts("cot delete " + s + ".") else{ [h(s)] = udefied puts("ok. " + s + " hs bee deleted.") 5 45 delete_elemet("") delete_elemet("foobr") serch("") ok. hs bee deleted. cot delete foobr. is udefied "", "ygoto-isseki", "kym"] fuctio mke_tble(){ vr = [] vr v = h(strs[i]) [v] = strs[i] retur puts(mke_tble()),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,h r,,,,ygoto,,,,,,,,,,,,,ky m,,,,,,,,,,,,ued,,,,,,,,,,,,,,ygo to-isseki,,,,,,,,,,,,,bc 1 3 for (; i < s.legth; i++){ = ( * 34 + s.chrcodeat(i)) % 13 "", "ygoto-isseki", "kym"] puts(strs[i] + " : " + h(strs[i])) : : 4 bc : 8 : ued : hr : : ygoto-isseki : 1 kym :, ued, hr,, kym

2 "", "ygoto-isseki", "kym"] fuctio mke_tble(){ vr = [] vr v = h(strs[i]) if ([v] === udefied) [v] = [strs[i]] else [v].push(strs[i]) retur puts(mke_tble().joi(" ")) 4 [ygoto-isseki] [] ygoto-isseki,ued,hr,,k ym,ygoto bc [, ued, hr,, kym] : : 4 bc : 8 : ued : hr : : ygoto-isseki : 1 kym : 8 [, ygoto] [bc ] i=1 1+ i 1 =1+ 1 m m i=1 (i 1) =1+ α 1 m O( + α/ 1/m) m m i xi E xi E[x 1 + x + + x m ]=E[x 1 ]+E[x ]+ + E[x m ]=E[] = = me[x i ] E[x i ]=/m = α 9 1 α O(1 + α) h(k) =k mod m m 10

3 p k = 0 3p + 1 p + p + 3 h(k) =k mod ( p 1) h(k) = 0 p p p + 1 p p + p + 3 = = tble vr v = h(dt) while (tble[v]!== udefied){ v = (v + 1) % 31 --> -->ygoto-isseki -->bc 8-->ygoto 9-->hr >kym > 3 1 bc : : 3 vr sum = 0 vr p = 55 for (; i < s.legth; i++){ vr c = s.chrcodeat(i) sum = (sum * 5 + c) % p retur sum fuctio work(s){ puts(s + ": " + h(s)) work("bc") work("bc") work("ymmoto") work("motoym") bc: 39 bc: 39 ymmoto: 10 motoym: vr v = (h(dt) + i + i * i) % 31 c * i + d * i * i if (tble[v] === udefied){ retur --> -->ygoto-isseki -->bc 8-->hr 9-->ygoto > 1kym 1 1--> 1 bc : : for (; i < s.legth; i++){ = ( * 34 + s.chrcodeat(i)) % 31 "", "ygoto-isseki", "kym"] puts(strs[i] + " : " + h(strs[i])) bc : : 3 vr v = (h(dt) + i * h(dt)) % 31 if (tble[v] === udefied){ retur fuctio h(s){ for (; i < s.legth; i++){ = ( * + s.chrcodeat(i)) %

4 --> -->ygoto-isseki -->bc 8-->ygoto 9--> > 1kym 1hr 1--> 3 bc : : 3 19 DEL fuctio serch_dt(tble, dt){ vr v = h(dt, i) vr v = h(dt, i) if (tble[v] === udefied){ if (tble[v] === dt){ retur v retur if (i >= m if (i >= m) brek; tble[v] === udefied) brek; puts("tble is full") ull /* * A hsh fuctio which outputs vlues * less th 0,011 */ fuctio h(pt){ vr s = 0 for (; i < 9; i++){ s = (s * pt[i]) % 0011 retur s fuctio eq_pt(pt1, pt){ for (; i < 9; i++){ if (pt1[i]!= pt[i]) retur flse retur true vr pt_tble = [] fuctio dd_pt(pt, dist){ vr v = h(pt) if (pt_tble[v] === udefied){ pt_tble[v] = [[pt, dist]] retur 1 else{ lst = pt_tble[v] for (; i < lst.legth; i++) if (eq_pt(lst[i][0], pt)) retur 0 pt_tble[v].push([pt, dist]) retur 1 fuctio fid_pt(pt){ vr v = h(pt) if (pt_tble[v] === udefied) retur -1 else { vr lst = pt_tble[v] for (; i < lst.legth; i++) if (eq_pt(lst[i][0], pt)) retur lst[i][1] retur -1

5 5 fuctio fid_zero(pt){ for (; i < 9; i++){ if (pt[i] == 0) retur i retur -1 fuctio work(){ vr iit_pt = [0, 1,, 3, 4, 5,,, 8] vr queue = [[iit_pt, 0]] vr couter = 0 while (queue.legth > 0){ vr [pt, dist] = queue.shift() vr ddist = fid_pt(pt) if (ddist < 0){ dd_pt(pt, dist) couter += 1 vr p = fid_zero(pt) vr px = p % 3 vr py = Mth.floor(p / 3) if (px > 0){ ppt[p] = ppt[p - 1] ppt[p - 1] = 0 if (px < ){ ppt[p] = ppt[p + 1] ppt[p + 1] = 0 if (py > 0){ ppt[p] = ppt[p - 3] ppt[p - 3] = 0 if (py < ){ ppt[p] = ppt[p + 3] ppt[p + 3] = 0 puts(couter)

I 11

I 11 I 11 2 h 345 645 3 var strs = ["meijo", "university", "abc", "shiogama","yagoto", "ueda", "hara", "irinaka", "yagoto-nisseki", "kanayama"] function make_table(){ var a = [] for (var i = 0; i < strs.length;

More information

-34-

-34- -33- -34- ! -35- ! -36- ! -37- -38- -39- -40- -41- -42- -43- -44- -45- -46- -47- -48- -49- -50- ! -51- -52- !! -53- -54- ! -55- -56- -57- !!!!! "" "!!! " "" " -58- -59- !!! -60- -61- -62- -63- ! -64- !

More information

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb " # $ % & ' ( ) * +, -. / 0 1 2 3 4 5 6 7 8 9 : ; < = >? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y " # $ % & ' ( ) * + , -. / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B

More information

" " " " "!!

    !! ""!!!!! "! "! " " " " " " " "!! !!!!!!!!! ! !!!!! "β!"β"! " " "!! "! "!!! "!! !!! "! "!!!! "! !!!!! !!! " "!! "!!! " " "!!! ! "!! !!!!!!! " " " " "!! α!!!!! ! "! " " !!!!!!! "! ! ""!!!! !!!!!! " "! "!

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション "# "# $%&' "#$% $# & $# $% % ' ()(*"#$% +,(- ()(*"#$%.' ()(* $/.0##'' %0$&0% 1*2#/0/%'&0343$56 789#/0/'%&04../ "3"0##"$ "0%0$" "7 1*2#.30///04%.$ 789#.30///0#$'4 http://www.ibie2016.com/exhibitorlist/

More information

橡Taro9-生徒の活動.PDF

橡Taro9-生徒の活動.PDF 3 1 4 1 20 30 2 2 3-1- 1 2-2- -3- 18 1200 1 4-4- -5- 15 5 25 5-6- 1 4 2 1 10 20 2 3-7- 1 2 3 150 431 338-8- 2 3 100 4 5 6 7 1-9- 1291-10 - -11 - 10 1 35 2 3 1866 68 4 1871 1873 5 6-12 - 1 2 3 4 1 4-13

More information

ワードプロセッシングについて

ワードプロセッシングについて Word Word ONOFF (U)(P) ******** 1 OS Windows2000 Windows2000 (U) OK 2 Windows 3 Word 1) 2) (F)(O) A() FD(A) Word 4 1) / > < *.? " : ; 2) SAMPLE2 A SAMPLE2 5 .doc 6 Alt f6f9 7 + 8 ) 2) 9 1) 2) 1) 10 2)

More information

超簡単、売上入力画面作成

超簡単、売上入力画面作成 19 1 10 Access Access 1. Access [ ] < 1 > 2. Access [ ] 3. [ ] [ ] 4. < 2 > 1. [ ] [ ] [ ] [ ] [ ] 2. [ ] < 3 > 3. [ ] 4. [ ] [ ] 5. [ ] < 4 > [ ] Yes/No [ ] 6. < 5 > 1. [ ] [ ] 2. [ ] < 6 > 3. [ ] [ ]

More information

... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2

... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2 1 ... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2 3 4 5 6 7 8 9 Excel2007 10 Excel2007 11 12 13 - 14 15 16 17 18 19 20 21 22 Excel2007

More information

S1460...........\1.E4

S1460...........\1.E4 3 4 3 4 5 3 4 5 3 4 3 4 3 3 3 3 4 3 4 3 3 4 4 3 3 3 3 4 3 4 3 3 3 3 3 3 4 3 4 3 4 5 4 3 5 4 3 3 4 5 3 4 5 4 3 4 3 3 4 3 4 3 3 3 3 3 4 3 3 4! "! " " 0 6 ! " 3 4 3 3 4 3 ! " 3 3 4 5 4 5 6 3 3

More information

-----------------------------------------------------------------------------------------1 --------------------------------------------------------------------------------------1 -------------------------------------------------------------------------------------1

More information

›¼’à”v“lŠÍ1−ª

›¼’à”v“lŠÍ1−ª 3 1 1 2 3 4 5 6 7 8 8 10 12 14 16 18 20 22 24 2 1 2 3 4 5 6 7 8 9 10 11 12 26 28 30 32 34 36 38 40 42 44 46 48 50 4 3 1 2 3 4 5 52 54 56 58 60 6 62 7 8 9 10 64 66 68 70 72 5 1 1 4 2 5 6 6 7 1 8 1 9 2 10

More information

1 2 3 4 1 2 3 4 1 2 3 4 12 3 4

1 2 3 4 1 2 3 4 1 2 3 4 12 3 4 1 2 3 4 5 6 1 2 3 4 5 6 1 2 1 2 1 2 1 2 1 2 3 4 12 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 12 3 4 1 2 3 4 5 6 7 8 1 2 3 46 7 1 2 3 4 5 6 7 1 2 3 4 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 16 7 8 92 3 46 7 :

More information

- 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 2-12 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 1 - 2 - 3 6 1 1-4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 130 3 130 5 2 50 1.5 48 59 62 63-9 - 1 - 2 - 3 () - 4 - 5 -

More information

平塚信用金庫の現況 2015

平塚信用金庫の現況 2015 2015 1 2 3 1 2 3 4 5 6 7 1 2 3 4 5 8 9 @ A B C D E F G H I J K HK L M N O P Q R T R T S T U V W 1 2 3 4 5 6 E F C J I O M N K L H 8 7 G D 0 A 6 9 5

More information

Taro13-第6章(まとめ).PDF

Taro13-第6章(まとめ).PDF % % % % % % % % 31 NO 1 52,422 10,431 19.9 10,431 19.9 1,380 2.6 1,039 2.0 33,859 64.6 5,713 10.9 2 8,292 1,591 19.2 1,591 19.2 1,827 22.0 1,782 21.5 1,431 17.3 1,661 20.0 3 1,948 1,541 79.1 1,541 79.1

More information

プログラム

プログラム !!!!!!!! !!!!!!! "! !!!!!!!!!! !!!!!! !! !! !!!! !! " " " !!!! !!! "!! !! " !! " !!!! !! "!!! !!!!!! " " !!!!!!!!!!!! !!!!!! ρ!!"! " " " " " " " " "!!! " " " " " " "!! "" !! !!!! "!! " "!! ρ !!!! " "!!

More information

P-12 P-13 3 4 28 16 00 17 30 P-14 P-15 P-16 4 14 29 17 00 18 30 P-17 P-18 P-19 P-20 P-21 P-22

P-12 P-13 3 4 28 16 00 17 30 P-14 P-15 P-16 4 14 29 17 00 18 30 P-17 P-18 P-19 P-20 P-21 P-22 1 14 28 16 00 17 30 P-1 P-2 P-3 P-4 P-5 2 24 29 17 00 18 30 P-6 P-7 P-8 P-9 P-10 P-11 P-12 P-13 3 4 28 16 00 17 30 P-14 P-15 P-16 4 14 29 17 00 18 30 P-17 P-18 P-19 P-20 P-21 P-22 5 24 28 16 00 17 30 P-23

More information

http://banso.cocolog-nifty.com/ 100 100 250 5 1 1 http://www.banso.com/ 2009 5 2 10 http://www.banso.com/ 2009 5 2 http://www.banso.com/ 2009 5 2 http://www.banso.com/ < /> < /> / http://www.banso.com/

More information

H27 28 4 1 11,353 45 14 10 120 27 90 26 78 323 401 27 11,120 D A BC 11,120 H27 33 H26 38 H27 35 40 126,154 129,125 130,000 150,000 5,961 11,996 6,000 15,000 688,684 708,924 700,000 750,000 1300 H28

More information

n=360 28.6% 34.4% 36.9% n=360 2.5% 17.8% 19.2% n=64 0.8% 0.3% n=69 1.7% 3.6% 0.6% 1.4% 1.9% < > n=218 1.4% 5.6% 3.1% 60.6% 0.6% 6.9% 10.8% 6.4% 10.3% 33.1% 1.4% 3.6% 1.1% 0.0% 3.1% n=360 0% 50%

More information

土壌環境行政の最新動向(環境省 水・大気環境局土壌環境課)

土壌環境行政の最新動向(環境省 水・大気環境局土壌環境課) 201022 1 18801970 19101970 19201960 1970-2 1975 1980 1986 1991 1994 3 1999 20022009 4 5 () () () () ( ( ) () 6 7 Ex Ex Ex 8 25 9 10 11 16619 123 12 13 14 5 18() 15 187 1811 16 17 3,000 2241 18 19 ( 50

More information

syuryoku

syuryoku 248 24622 24 P.5 EX P.212 2 P271 5. P.534 P.690 P.690 P.690 P.690 P.691 P.691 P.691 P.702 P.702 P.702 P.702 1S 30% 3 1S 3% 1S 30% 3 1S 3% P.702 P.702 P.702 P.702 45 60 P.702 P.702 P.704 H17.12.22 H22.4.1

More information

情報科学概論 第1回資料

情報科学概論 第1回資料 1. Excel (C) Hiroshi Pen Fujimori 1 2. (Excel) 2.1 Excel : 2.2Excel Excel (C) Hiroshi Pen Fujimori 2 256 (IV) :C (C 65536 B4 :2 (2 A3 Excel (C) Hiroshi Pen Fujimori 3 Tips: (1) B3 (2) (*1) (3) (4)Word

More information

2

2 2 5 6 8 9 (1) (2) (3) 10 11 (1) (2) (3) 36 (1) (2) (3) (4) 37 (1) (2) (3) 42 3 4 3 24 3 3 3 20 59 20 33 20 18 3 25 3 5 3 19 21 3 22 10 16 6 23 4 1 24 3 31 1 1. 4 1 5 5 6 6 6 23 6 23 6 30 7 21 12 1 12 15

More information

項 目

項 目 1 1 2 3 11 4 6 5 7,000 2 120 1.3 4,000 04 450 < > 5 3 6 7 8 9 4 10 11 5 12 45 6 13 E. 7 B. C. 14 15 16 17 18 19 20 21 22 23 8 24 25 9 27 2 26 6 27 3 1 3 3 28 29 30 9 31 32 33 500 1 4000 0 2~3 10 10 34

More information

橡統計担当者のためのエクセル表紙.PDF

橡統計担当者のためのエクセル表紙.PDF Num Lock(Pad Lock) ( Num Lock) [ ][ ] [ ][ ] Alt Alt 4 + ( ) 3+3 - ( ) 3-1 -1 * ( ) 3*3 / ( ) 3/3 % ( ) 20% ^ ( ) 3^2 (3*3 ) 2 TRUE FALSE = ( ) A1=B1 > ( ) A1>B1 < ( ) A1= ( ) A1>=B1

More information

דוח דירקטוריון - חברה 012010 - גר 9 - 300510

דוח דירקטוריון - חברה 012010 - גר 9 - 300510 13060608060408 0704 0609030606 060705 050607 040007030501 0606070804060708 0300''6 1 6 1''06''6 1 0606050706010708 31.03.10 04010705 030902010105 0507090708 13050607 060705 060608060408 0704 0609030606

More information

untitled

untitled 280 200 5 7,800 6 8,600 28 1 1 18 7 8 2 ( 31 ) 7 42 2 / / / / / / / / / / 1 3 (1) 4 5 3 1 1 1 A B C D 6 (1) -----) (2) -- ()) (3) ----(). ()() () ( )( )( )( ) ( ) ( )( )( )( ) () (). () ()() 7 () ( ) 1

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション SumStock 1 .... 2 3 4 5 1 2 3 6 OK NO OK NO SUMSTOCK 7 8 : ( ( DIY 9 10 FGCDJHH 5 15 15 50 B. B. A B A B F G C D E H H I J + + F.. G A. B.. 11 C.. 5 12 D 100 10080 8060 6040 40 90 90150 150. J 13 H LDK

More information

fp.gby

fp.gby 1 1 2 2 3 2 4 5 6 7 8 9 10 11 Haskell 12 13 Haskell 14 15 ( ) 16 ) 30 17 static 18 (IORef) 19 20 OK NG 21 Haskell (+) :: Num a => a -> a -> a sort :: Ord a => [a] -> [a] delete :: Eq a => a -> [a] -> [a]

More information

コーディング基準.PDF

コーディング基準.PDF Java Java Java Java.java.class 1 private public package import / //////////////////////////////////////////////////////////////////////////////// // // // // ////////////////////////////////////////////////////////////////////////////////

More information

野岩鉄道の旅

野岩鉄道の旅 29th 5:13 5:34 5:56 6:00 6:12 6:20 6:21 6:25 6:29 6:31 6:34 6:38 6:40 6:45 6:52 6:56 7:01 7:07 7:11 7:32 7:34 7:50 7:58 8:03 8:17 8:36 8:44 5:50 5:54 6:15 6:38 6:39 6:51 6:59 6:59 7:03 7:08 7:08 7:11 7:15

More information