関数(とその他の数学とコンピュータに関する予備知識) 入門 mapに存在するキーかの判定方法、辞書のスライス、n進数、底
行列プログラマー (Philip N. Klein(著)、松田 晃一(翻訳)、弓林 司(翻訳)、脇本 佑紀(翻訳)、中田 洋(翻訳)、齋藤 大吾(翻訳)、オライリー・ジャパン)の0章(関数(とその他の数学とコンピュータに関する予備知識))、0.5(ラボ: Python入門 - 集合、リスト、辞書、内包表記)、0.5.8(辞書)、辞書のリストの課題0.5.21、0.5.22、辞書の内包表記の課題0.5.23、0.5.24、0.5.25、辞書を処理する内包表記の課題0.5.26の解答をPythonではなくGoで求めてみる。
コード
package main
import "fmt"
type stringSet map[string]bool
func newStringSet(strSlice []string) stringSet {
ss := map[string]bool{}
for _, s := range strSlice {
ss[s] = true
}
return stringSet(ss)
}
func main() {
fmt.Println("課題0.5.21")
mapSlice := []map[string]string{
{"James": "Sean", "director": "Terence"},
{"James": "Roger", "director": "Lewis"},
{"James": "Pierce", "director": "Roger"},
}
k := "James"
s := []string{}
for _, m := range mapSlice {
s = append(s, m[k])
}
fmt.Println(s)
fmt.Println("課題0.5.22")
mapSlice = []map[string]string{
{"Bilbo": "Ian", "Frodo": "Elijah"},
{"Bilbo": "Martin", "Thjorin": "Richard"},
}
s = []string{}
k = "Bilbo"
for _, m := range mapSlice {
v, ok := m[k]
if ok {
s = append(s, v)
} else {
s = append(s, "NOT PRESENT")
}
}
fmt.Println(s)
s = []string{}
k = "Frodo"
for _, m := range mapSlice {
v, ok := m[k]
if ok {
s = append(s, v)
} else {
s = append(s, "NOT PRESENT")
}
}
fmt.Println(s)
fmt.Println("課題0.5.23")
squareMap := map[int]int{}
for i := 0; i < 100; i++ {
squareMap[i] = i * i
}
for k, v := range squareMap {
fmt.Println(k, v)
}
fmt.Println("課題0.5.24")
ss := newStringSet([]string{"red", "white", "blue"})
id := map[string]string{}
for k := range ss {
id[k] = k
}
fmt.Println(id)
fmt.Println("課題0.5.25")
for _, base := range []int{10, 2} {
fmt.Println("base =", base)
m := map[int][3]int{}
for n := 0; ; n++ {
digits := [3]int{0, 0, 0}
for j := 0; j < n; j++ {
i := len(digits) - 1
for digits[i] == base-1 {
digits[i] = 0
i--
}
digits[i]++
}
m[n] = digits
if digits[0] == base-1 &&
digits[1] == base-1 &&
digits[2] == base-1 {
break
}
}
for i := 0; i < len(m); i++ {
if i%10 == 0 {
fmt.Println()
}
fmt.Printf("%v: %v, ", i, m[i])
}
fmt.Println()
}
fmt.Println("課題0.5.26")
salaries := map[int]float64{0: 1000.0, 3: 990, 1: 1200.50}
names := []string{"Larry", "Curly", "", "Moe"}
namesSararies := map[string]float64{}
for k, v := range salaries {
namesSararies[names[k]] = v
}
fmt.Println(namesSararies)
}
入出力結果
% go run ./main.go
課題0.5.21
[Sean Roger Pierce]
課題0.5.22
[Ian Martin]
[Elijah NOT PRESENT]
課題0.5.23
82 6724
88 7744
97 9409
22 484
32 1024
59 3481
73 5329
76 5776
58 3364
72 5184
1 1
11 121
30 900
36 1296
39 1521
79 6241
94 8836
14 196
19 361
48 2304
49 2401
61 3721
56 3136
81 6561
87 7569
23 529
28 784
43 1849
44 1936
45 2025
98 9604
46 2116
50 2500
51 2601
3 9
20 400
24 576
26 676
27 729
55 3025
83 6889
70 4900
74 5476
84 7056
92 8464
99 9801
93 8649
95 9025
4 16
12 144
21 441
65 4225
67 4489
64 4096
69 4761
77 5929
15 225
38 1444
40 1600
53 2809
60 3600
7 49
13 169
47 2209
52 2704
86 7396
9 81
62 3844
78 6084
29 841
71 5041
0 0
6 36
10 100
17 289
25 625
31 961
41 1681
89 7921
90 8100
96 9216
2 4
16 256
42 1764
68 4624
63 3969
66 4356
54 2916
80 6400
85 7225
5 25
8 64
18 324
33 1089
34 1156
91 8281
35 1225
37 1369
57 3249
75 5625
課題0.5.24
map[blue:blue red:red white:white]
課題0.5.25
base = 10
0: [0 0 0], 1: [0 0 1], 2: [0 0 2], 3: [0 0 3], 4: [0 0 4], 5: [0 0 5], 6: [0 0 6], 7: [0 0 7], 8: [0 0 8], 9: [0 0 9],
10: [0 1 0], 11: [0 1 1], 12: [0 1 2], 13: [0 1 3], 14: [0 1 4], 15: [0 1 5], 16: [0 1 6], 17: [0 1 7], 18: [0 1 8], 19: [0 1 9],
20: [0 2 0], 21: [0 2 1], 22: [0 2 2], 23: [0 2 3], 24: [0 2 4], 25: [0 2 5], 26: [0 2 6], 27: [0 2 7], 28: [0 2 8], 29: [0 2 9],
30: [0 3 0], 31: [0 3 1], 32: [0 3 2], 33: [0 3 3], 34: [0 3 4], 35: [0 3 5], 36: [0 3 6], 37: [0 3 7], 38: [0 3 8], 39: [0 3 9],
40: [0 4 0], 41: [0 4 1], 42: [0 4 2], 43: [0 4 3], 44: [0 4 4], 45: [0 4 5], 46: [0 4 6], 47: [0 4 7], 48: [0 4 8], 49: [0 4 9],
50: [0 5 0], 51: [0 5 1], 52: [0 5 2], 53: [0 5 3], 54: [0 5 4], 55: [0 5 5], 56: [0 5 6], 57: [0 5 7], 58: [0 5 8], 59: [0 5 9],
60: [0 6 0], 61: [0 6 1], 62: [0 6 2], 63: [0 6 3], 64: [0 6 4], 65: [0 6 5], 66: [0 6 6], 67: [0 6 7], 68: [0 6 8], 69: [0 6 9],
70: [0 7 0], 71: [0 7 1], 72: [0 7 2], 73: [0 7 3], 74: [0 7 4], 75: [0 7 5], 76: [0 7 6], 77: [0 7 7], 78: [0 7 8], 79: [0 7 9],
80: [0 8 0], 81: [0 8 1], 82: [0 8 2], 83: [0 8 3], 84: [0 8 4], 85: [0 8 5], 86: [0 8 6], 87: [0 8 7], 88: [0 8 8], 89: [0 8 9],
90: [0 9 0], 91: [0 9 1], 92: [0 9 2], 93: [0 9 3], 94: [0 9 4], 95: [0 9 5], 96: [0 9 6], 97: [0 9 7], 98: [0 9 8], 99: [0 9 9],
100: [1 0 0], 101: [1 0 1], 102: [1 0 2], 103: [1 0 3], 104: [1 0 4], 105: [1 0 5], 106: [1 0 6], 107: [1 0 7], 108: [1 0 8], 109: [1 0 9],
110: [1 1 0], 111: [1 1 1], 112: [1 1 2], 113: [1 1 3], 114: [1 1 4], 115: [1 1 5], 116: [1 1 6], 117: [1 1 7], 118: [1 1 8], 119: [1 1 9],
120: [1 2 0], 121: [1 2 1], 122: [1 2 2], 123: [1 2 3], 124: [1 2 4], 125: [1 2 5], 126: [1 2 6], 127: [1 2 7], 128: [1 2 8], 129: [1 2 9],
130: [1 3 0], 131: [1 3 1], 132: [1 3 2], 133: [1 3 3], 134: [1 3 4], 135: [1 3 5], 136: [1 3 6], 137: [1 3 7], 138: [1 3 8], 139: [1 3 9],
140: [1 4 0], 141: [1 4 1], 142: [1 4 2], 143: [1 4 3], 144: [1 4 4], 145: [1 4 5], 146: [1 4 6], 147: [1 4 7], 148: [1 4 8], 149: [1 4 9],
150: [1 5 0], 151: [1 5 1], 152: [1 5 2], 153: [1 5 3], 154: [1 5 4], 155: [1 5 5], 156: [1 5 6], 157: [1 5 7], 158: [1 5 8], 159: [1 5 9],
160: [1 6 0], 161: [1 6 1], 162: [1 6 2], 163: [1 6 3], 164: [1 6 4], 165: [1 6 5], 166: [1 6 6], 167: [1 6 7], 168: [1 6 8], 169: [1 6 9],
170: [1 7 0], 171: [1 7 1], 172: [1 7 2], 173: [1 7 3], 174: [1 7 4], 175: [1 7 5], 176: [1 7 6], 177: [1 7 7], 178: [1 7 8], 179: [1 7 9],
180: [1 8 0], 181: [1 8 1], 182: [1 8 2], 183: [1 8 3], 184: [1 8 4], 185: [1 8 5], 186: [1 8 6], 187: [1 8 7], 188: [1 8 8], 189: [1 8 9],
190: [1 9 0], 191: [1 9 1], 192: [1 9 2], 193: [1 9 3], 194: [1 9 4], 195: [1 9 5], 196: [1 9 6], 197: [1 9 7], 198: [1 9 8], 199: [1 9 9],
200: [2 0 0], 201: [2 0 1], 202: [2 0 2], 203: [2 0 3], 204: [2 0 4], 205: [2 0 5], 206: [2 0 6], 207: [2 0 7], 208: [2 0 8], 209: [2 0 9],
210: [2 1 0], 211: [2 1 1], 212: [2 1 2], 213: [2 1 3], 214: [2 1 4], 215: [2 1 5], 216: [2 1 6], 217: [2 1 7], 218: [2 1 8], 219: [2 1 9],
220: [2 2 0], 221: [2 2 1], 222: [2 2 2], 223: [2 2 3], 224: [2 2 4], 225: [2 2 5], 226: [2 2 6], 227: [2 2 7], 228: [2 2 8], 229: [2 2 9],
230: [2 3 0], 231: [2 3 1], 232: [2 3 2], 233: [2 3 3], 234: [2 3 4], 235: [2 3 5], 236: [2 3 6], 237: [2 3 7], 238: [2 3 8], 239: [2 3 9],
240: [2 4 0], 241: [2 4 1], 242: [2 4 2], 243: [2 4 3], 244: [2 4 4], 245: [2 4 5], 246: [2 4 6], 247: [2 4 7], 248: [2 4 8], 249: [2 4 9],
250: [2 5 0], 251: [2 5 1], 252: [2 5 2], 253: [2 5 3], 254: [2 5 4], 255: [2 5 5], 256: [2 5 6], 257: [2 5 7], 258: [2 5 8], 259: [2 5 9],
260: [2 6 0], 261: [2 6 1], 262: [2 6 2], 263: [2 6 3], 264: [2 6 4], 265: [2 6 5], 266: [2 6 6], 267: [2 6 7], 268: [2 6 8], 269: [2 6 9],
270: [2 7 0], 271: [2 7 1], 272: [2 7 2], 273: [2 7 3], 274: [2 7 4], 275: [2 7 5], 276: [2 7 6], 277: [2 7 7], 278: [2 7 8], 279: [2 7 9],
280: [2 8 0], 281: [2 8 1], 282: [2 8 2], 283: [2 8 3], 284: [2 8 4], 285: [2 8 5], 286: [2 8 6], 287: [2 8 7], 288: [2 8 8], 289: [2 8 9],
290: [2 9 0], 291: [2 9 1], 292: [2 9 2], 293: [2 9 3], 294: [2 9 4], 295: [2 9 5], 296: [2 9 6], 297: [2 9 7], 298: [2 9 8], 299: [2 9 9],
300: [3 0 0], 301: [3 0 1], 302: [3 0 2], 303: [3 0 3], 304: [3 0 4], 305: [3 0 5], 306: [3 0 6], 307: [3 0 7], 308: [3 0 8], 309: [3 0 9],
310: [3 1 0], 311: [3 1 1], 312: [3 1 2], 313: [3 1 3], 314: [3 1 4], 315: [3 1 5], 316: [3 1 6], 317: [3 1 7], 318: [3 1 8], 319: [3 1 9],
320: [3 2 0], 321: [3 2 1], 322: [3 2 2], 323: [3 2 3], 324: [3 2 4], 325: [3 2 5], 326: [3 2 6], 327: [3 2 7], 328: [3 2 8], 329: [3 2 9],
330: [3 3 0], 331: [3 3 1], 332: [3 3 2], 333: [3 3 3], 334: [3 3 4], 335: [3 3 5], 336: [3 3 6], 337: [3 3 7], 338: [3 3 8], 339: [3 3 9],
340: [3 4 0], 341: [3 4 1], 342: [3 4 2], 343: [3 4 3], 344: [3 4 4], 345: [3 4 5], 346: [3 4 6], 347: [3 4 7], 348: [3 4 8], 349: [3 4 9],
350: [3 5 0], 351: [3 5 1], 352: [3 5 2], 353: [3 5 3], 354: [3 5 4], 355: [3 5 5], 356: [3 5 6], 357: [3 5 7], 358: [3 5 8], 359: [3 5 9],
360: [3 6 0], 361: [3 6 1], 362: [3 6 2], 363: [3 6 3], 364: [3 6 4], 365: [3 6 5], 366: [3 6 6], 367: [3 6 7], 368: [3 6 8], 369: [3 6 9],
370: [3 7 0], 371: [3 7 1], 372: [3 7 2], 373: [3 7 3], 374: [3 7 4], 375: [3 7 5], 376: [3 7 6], 377: [3 7 7], 378: [3 7 8], 379: [3 7 9],
380: [3 8 0], 381: [3 8 1], 382: [3 8 2], 383: [3 8 3], 384: [3 8 4], 385: [3 8 5], 386: [3 8 6], 387: [3 8 7], 388: [3 8 8], 389: [3 8 9],
390: [3 9 0], 391: [3 9 1], 392: [3 9 2], 393: [3 9 3], 394: [3 9 4], 395: [3 9 5], 396: [3 9 6], 397: [3 9 7], 398: [3 9 8], 399: [3 9 9],
400: [4 0 0], 401: [4 0 1], 402: [4 0 2], 403: [4 0 3], 404: [4 0 4], 405: [4 0 5], 406: [4 0 6], 407: [4 0 7], 408: [4 0 8], 409: [4 0 9],
410: [4 1 0], 411: [4 1 1], 412: [4 1 2], 413: [4 1 3], 414: [4 1 4], 415: [4 1 5], 416: [4 1 6], 417: [4 1 7], 418: [4 1 8], 419: [4 1 9],
420: [4 2 0], 421: [4 2 1], 422: [4 2 2], 423: [4 2 3], 424: [4 2 4], 425: [4 2 5], 426: [4 2 6], 427: [4 2 7], 428: [4 2 8], 429: [4 2 9],
430: [4 3 0], 431: [4 3 1], 432: [4 3 2], 433: [4 3 3], 434: [4 3 4], 435: [4 3 5], 436: [4 3 6], 437: [4 3 7], 438: [4 3 8], 439: [4 3 9],
440: [4 4 0], 441: [4 4 1], 442: [4 4 2], 443: [4 4 3], 444: [4 4 4], 445: [4 4 5], 446: [4 4 6], 447: [4 4 7], 448: [4 4 8], 449: [4 4 9],
450: [4 5 0], 451: [4 5 1], 452: [4 5 2], 453: [4 5 3], 454: [4 5 4], 455: [4 5 5], 456: [4 5 6], 457: [4 5 7], 458: [4 5 8], 459: [4 5 9],
460: [4 6 0], 461: [4 6 1], 462: [4 6 2], 463: [4 6 3], 464: [4 6 4], 465: [4 6 5], 466: [4 6 6], 467: [4 6 7], 468: [4 6 8], 469: [4 6 9],
470: [4 7 0], 471: [4 7 1], 472: [4 7 2], 473: [4 7 3], 474: [4 7 4], 475: [4 7 5], 476: [4 7 6], 477: [4 7 7], 478: [4 7 8], 479: [4 7 9],
480: [4 8 0], 481: [4 8 1], 482: [4 8 2], 483: [4 8 3], 484: [4 8 4], 485: [4 8 5], 486: [4 8 6], 487: [4 8 7], 488: [4 8 8], 489: [4 8 9],
490: [4 9 0], 491: [4 9 1], 492: [4 9 2], 493: [4 9 3], 494: [4 9 4], 495: [4 9 5], 496: [4 9 6], 497: [4 9 7], 498: [4 9 8], 499: [4 9 9],
500: [5 0 0], 501: [5 0 1], 502: [5 0 2], 503: [5 0 3], 504: [5 0 4], 505: [5 0 5], 506: [5 0 6], 507: [5 0 7], 508: [5 0 8], 509: [5 0 9],
510: [5 1 0], 511: [5 1 1], 512: [5 1 2], 513: [5 1 3], 514: [5 1 4], 515: [5 1 5], 516: [5 1 6], 517: [5 1 7], 518: [5 1 8], 519: [5 1 9],
520: [5 2 0], 521: [5 2 1], 522: [5 2 2], 523: [5 2 3], 524: [5 2 4], 525: [5 2 5], 526: [5 2 6], 527: [5 2 7], 528: [5 2 8], 529: [5 2 9],
530: [5 3 0], 531: [5 3 1], 532: [5 3 2], 533: [5 3 3], 534: [5 3 4], 535: [5 3 5], 536: [5 3 6], 537: [5 3 7], 538: [5 3 8], 539: [5 3 9],
540: [5 4 0], 541: [5 4 1], 542: [5 4 2], 543: [5 4 3], 544: [5 4 4], 545: [5 4 5], 546: [5 4 6], 547: [5 4 7], 548: [5 4 8], 549: [5 4 9],
550: [5 5 0], 551: [5 5 1], 552: [5 5 2], 553: [5 5 3], 554: [5 5 4], 555: [5 5 5], 556: [5 5 6], 557: [5 5 7], 558: [5 5 8], 559: [5 5 9],
560: [5 6 0], 561: [5 6 1], 562: [5 6 2], 563: [5 6 3], 564: [5 6 4], 565: [5 6 5], 566: [5 6 6], 567: [5 6 7], 568: [5 6 8], 569: [5 6 9],
570: [5 7 0], 571: [5 7 1], 572: [5 7 2], 573: [5 7 3], 574: [5 7 4], 575: [5 7 5], 576: [5 7 6], 577: [5 7 7], 578: [5 7 8], 579: [5 7 9],
580: [5 8 0], 581: [5 8 1], 582: [5 8 2], 583: [5 8 3], 584: [5 8 4], 585: [5 8 5], 586: [5 8 6], 587: [5 8 7], 588: [5 8 8], 589: [5 8 9],
590: [5 9 0], 591: [5 9 1], 592: [5 9 2], 593: [5 9 3], 594: [5 9 4], 595: [5 9 5], 596: [5 9 6], 597: [5 9 7], 598: [5 9 8], 599: [5 9 9],
600: [6 0 0], 601: [6 0 1], 602: [6 0 2], 603: [6 0 3], 604: [6 0 4], 605: [6 0 5], 606: [6 0 6], 607: [6 0 7], 608: [6 0 8], 609: [6 0 9],
610: [6 1 0], 611: [6 1 1], 612: [6 1 2], 613: [6 1 3], 614: [6 1 4], 615: [6 1 5], 616: [6 1 6], 617: [6 1 7], 618: [6 1 8], 619: [6 1 9],
620: [6 2 0], 621: [6 2 1], 622: [6 2 2], 623: [6 2 3], 624: [6 2 4], 625: [6 2 5], 626: [6 2 6], 627: [6 2 7], 628: [6 2 8], 629: [6 2 9],
630: [6 3 0], 631: [6 3 1], 632: [6 3 2], 633: [6 3 3], 634: [6 3 4], 635: [6 3 5], 636: [6 3 6], 637: [6 3 7], 638: [6 3 8], 639: [6 3 9],
640: [6 4 0], 641: [6 4 1], 642: [6 4 2], 643: [6 4 3], 644: [6 4 4], 645: [6 4 5], 646: [6 4 6], 647: [6 4 7], 648: [6 4 8], 649: [6 4 9],
650: [6 5 0], 651: [6 5 1], 652: [6 5 2], 653: [6 5 3], 654: [6 5 4], 655: [6 5 5], 656: [6 5 6], 657: [6 5 7], 658: [6 5 8], 659: [6 5 9],
660: [6 6 0], 661: [6 6 1], 662: [6 6 2], 663: [6 6 3], 664: [6 6 4], 665: [6 6 5], 666: [6 6 6], 667: [6 6 7], 668: [6 6 8], 669: [6 6 9],
670: [6 7 0], 671: [6 7 1], 672: [6 7 2], 673: [6 7 3], 674: [6 7 4], 675: [6 7 5], 676: [6 7 6], 677: [6 7 7], 678: [6 7 8], 679: [6 7 9],
680: [6 8 0], 681: [6 8 1], 682: [6 8 2], 683: [6 8 3], 684: [6 8 4], 685: [6 8 5], 686: [6 8 6], 687: [6 8 7], 688: [6 8 8], 689: [6 8 9],
690: [6 9 0], 691: [6 9 1], 692: [6 9 2], 693: [6 9 3], 694: [6 9 4], 695: [6 9 5], 696: [6 9 6], 697: [6 9 7], 698: [6 9 8], 699: [6 9 9],
700: [7 0 0], 701: [7 0 1], 702: [7 0 2], 703: [7 0 3], 704: [7 0 4], 705: [7 0 5], 706: [7 0 6], 707: [7 0 7], 708: [7 0 8], 709: [7 0 9],
710: [7 1 0], 711: [7 1 1], 712: [7 1 2], 713: [7 1 3], 714: [7 1 4], 715: [7 1 5], 716: [7 1 6], 717: [7 1 7], 718: [7 1 8], 719: [7 1 9],
720: [7 2 0], 721: [7 2 1], 722: [7 2 2], 723: [7 2 3], 724: [7 2 4], 725: [7 2 5], 726: [7 2 6], 727: [7 2 7], 728: [7 2 8], 729: [7 2 9],
730: [7 3 0], 731: [7 3 1], 732: [7 3 2], 733: [7 3 3], 734: [7 3 4], 735: [7 3 5], 736: [7 3 6], 737: [7 3 7], 738: [7 3 8], 739: [7 3 9],
740: [7 4 0], 741: [7 4 1], 742: [7 4 2], 743: [7 4 3], 744: [7 4 4], 745: [7 4 5], 746: [7 4 6], 747: [7 4 7], 748: [7 4 8], 749: [7 4 9],
750: [7 5 0], 751: [7 5 1], 752: [7 5 2], 753: [7 5 3], 754: [7 5 4], 755: [7 5 5], 756: [7 5 6], 757: [7 5 7], 758: [7 5 8], 759: [7 5 9],
760: [7 6 0], 761: [7 6 1], 762: [7 6 2], 763: [7 6 3], 764: [7 6 4], 765: [7 6 5], 766: [7 6 6], 767: [7 6 7], 768: [7 6 8], 769: [7 6 9],
770: [7 7 0], 771: [7 7 1], 772: [7 7 2], 773: [7 7 3], 774: [7 7 4], 775: [7 7 5], 776: [7 7 6], 777: [7 7 7], 778: [7 7 8], 779: [7 7 9],
780: [7 8 0], 781: [7 8 1], 782: [7 8 2], 783: [7 8 3], 784: [7 8 4], 785: [7 8 5], 786: [7 8 6], 787: [7 8 7], 788: [7 8 8], 789: [7 8 9],
790: [7 9 0], 791: [7 9 1], 792: [7 9 2], 793: [7 9 3], 794: [7 9 4], 795: [7 9 5], 796: [7 9 6], 797: [7 9 7], 798: [7 9 8], 799: [7 9 9],
800: [8 0 0], 801: [8 0 1], 802: [8 0 2], 803: [8 0 3], 804: [8 0 4], 805: [8 0 5], 806: [8 0 6], 807: [8 0 7], 808: [8 0 8], 809: [8 0 9],
810: [8 1 0], 811: [8 1 1], 812: [8 1 2], 813: [8 1 3], 814: [8 1 4], 815: [8 1 5], 816: [8 1 6], 817: [8 1 7], 818: [8 1 8], 819: [8 1 9],
820: [8 2 0], 821: [8 2 1], 822: [8 2 2], 823: [8 2 3], 824: [8 2 4], 825: [8 2 5], 826: [8 2 6], 827: [8 2 7], 828: [8 2 8], 829: [8 2 9],
830: [8 3 0], 831: [8 3 1], 832: [8 3 2], 833: [8 3 3], 834: [8 3 4], 835: [8 3 5], 836: [8 3 6], 837: [8 3 7], 838: [8 3 8], 839: [8 3 9],
840: [8 4 0], 841: [8 4 1], 842: [8 4 2], 843: [8 4 3], 844: [8 4 4], 845: [8 4 5], 846: [8 4 6], 847: [8 4 7], 848: [8 4 8], 849: [8 4 9],
850: [8 5 0], 851: [8 5 1], 852: [8 5 2], 853: [8 5 3], 854: [8 5 4], 855: [8 5 5], 856: [8 5 6], 857: [8 5 7], 858: [8 5 8], 859: [8 5 9],
860: [8 6 0], 861: [8 6 1], 862: [8 6 2], 863: [8 6 3], 864: [8 6 4], 865: [8 6 5], 866: [8 6 6], 867: [8 6 7], 868: [8 6 8], 869: [8 6 9],
870: [8 7 0], 871: [8 7 1], 872: [8 7 2], 873: [8 7 3], 874: [8 7 4], 875: [8 7 5], 876: [8 7 6], 877: [8 7 7], 878: [8 7 8], 879: [8 7 9],
880: [8 8 0], 881: [8 8 1], 882: [8 8 2], 883: [8 8 3], 884: [8 8 4], 885: [8 8 5], 886: [8 8 6], 887: [8 8 7], 888: [8 8 8], 889: [8 8 9],
890: [8 9 0], 891: [8 9 1], 892: [8 9 2], 893: [8 9 3], 894: [8 9 4], 895: [8 9 5], 896: [8 9 6], 897: [8 9 7], 898: [8 9 8], 899: [8 9 9],
900: [9 0 0], 901: [9 0 1], 902: [9 0 2], 903: [9 0 3], 904: [9 0 4], 905: [9 0 5], 906: [9 0 6], 907: [9 0 7], 908: [9 0 8], 909: [9 0 9],
910: [9 1 0], 911: [9 1 1], 912: [9 1 2], 913: [9 1 3], 914: [9 1 4], 915: [9 1 5], 916: [9 1 6], 917: [9 1 7], 918: [9 1 8], 919: [9 1 9],
920: [9 2 0], 921: [9 2 1], 922: [9 2 2], 923: [9 2 3], 924: [9 2 4], 925: [9 2 5], 926: [9 2 6], 927: [9 2 7], 928: [9 2 8], 929: [9 2 9],
930: [9 3 0], 931: [9 3 1], 932: [9 3 2], 933: [9 3 3], 934: [9 3 4], 935: [9 3 5], 936: [9 3 6], 937: [9 3 7], 938: [9 3 8], 939: [9 3 9],
940: [9 4 0], 941: [9 4 1], 942: [9 4 2], 943: [9 4 3], 944: [9 4 4], 945: [9 4 5], 946: [9 4 6], 947: [9 4 7], 948: [9 4 8], 949: [9 4 9],
950: [9 5 0], 951: [9 5 1], 952: [9 5 2], 953: [9 5 3], 954: [9 5 4], 955: [9 5 5], 956: [9 5 6], 957: [9 5 7], 958: [9 5 8], 959: [9 5 9],
960: [9 6 0], 961: [9 6 1], 962: [9 6 2], 963: [9 6 3], 964: [9 6 4], 965: [9 6 5], 966: [9 6 6], 967: [9 6 7], 968: [9 6 8], 969: [9 6 9],
970: [9 7 0], 971: [9 7 1], 972: [9 7 2], 973: [9 7 3], 974: [9 7 4], 975: [9 7 5], 976: [9 7 6], 977: [9 7 7], 978: [9 7 8], 979: [9 7 9],
980: [9 8 0], 981: [9 8 1], 982: [9 8 2], 983: [9 8 3], 984: [9 8 4], 985: [9 8 5], 986: [9 8 6], 987: [9 8 7], 988: [9 8 8], 989: [9 8 9],
990: [9 9 0], 991: [9 9 1], 992: [9 9 2], 993: [9 9 3], 994: [9 9 4], 995: [9 9 5], 996: [9 9 6], 997: [9 9 7], 998: [9 9 8], 999: [9 9 9],
base = 2
0: [0 0 0], 1: [0 0 1], 2: [0 1 0], 3: [0 1 1], 4: [1 0 0], 5: [1 0 1], 6: [1 1 0], 7: [1 1 1],
課題0.5.26
map[Curly:1200.5 Larry:1000 Moe:990]