回答編集履歴
4
修正
test
CHANGED
@@ -80,6 +80,40 @@
|
|
80
80
|
|
81
81
|
|
82
82
|
|
83
|
+
点数表
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
| | 番号 | 点数 |
|
88
|
+
|
89
|
+
|---:|:-------|-------:|
|
90
|
+
|
91
|
+
| 0 | {1} | 70 |
|
92
|
+
|
93
|
+
| 1 | {2} | 40 |
|
94
|
+
|
95
|
+
| 2 | {3} | 50 |
|
96
|
+
|
97
|
+
| 3 | {4} | 30 |
|
98
|
+
|
99
|
+
| 4 | {5} | 90 |
|
100
|
+
|
101
|
+
| 5 | {6} | 15 |
|
102
|
+
|
103
|
+
| 6 | {7} | 35 |
|
104
|
+
|
105
|
+
| 7 | {8} | 65 |
|
106
|
+
|
107
|
+
| 8 | {1, 3} | 20 |
|
108
|
+
|
109
|
+
| 9 | {1, 7} | 30 |
|
110
|
+
|
111
|
+
| 10 | {3, 6} | 12 |
|
112
|
+
|
113
|
+
| 11 | {8, 2} | 40 |
|
114
|
+
|
115
|
+
|
116
|
+
|
83
117
|
入力: 2.8
|
84
118
|
|
85
119
|
|
3
修正
test
CHANGED
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
+
# 番号は順不同なので、set で作成する
|
22
|
+
|
21
23
|
scores = pd.DataFrame(
|
22
24
|
|
23
25
|
{
|
@@ -32,15 +34,9 @@
|
|
32
34
|
|
33
35
|
|
34
36
|
|
35
|
-
nums = 1, 3, 6
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
37
|
def get_match_scores(*args):
|
42
38
|
|
43
|
-
max_len = scores["番号"].apply(len).max()
|
39
|
+
max_len = scores["番号"].apply(len).max() # 点数表のパターンの最大の長さ
|
44
40
|
|
45
41
|
|
46
42
|
|
2
修正
test
CHANGED
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
patterns = []
|
50
50
|
|
51
|
-
for r in range(1, max_len +
|
51
|
+
for r in range(1, max_len + 1):
|
52
52
|
|
53
53
|
for p in itertools.combinations(args, r):
|
54
54
|
|
1
修正
test
CHANGED
@@ -92,15 +92,15 @@
|
|
92
92
|
|
93
93
|
|
94
94
|
|
95
|
-
|
|
95
|
+
| 番号 | 点数 |
|
96
96
|
|
97
|
-
|
|
97
|
+
|:-------|-------:|
|
98
98
|
|
99
|
-
|
|
99
|
+
| {2} | 40 |
|
100
100
|
|
101
|
-
|
|
101
|
+
| {8} | 65 |
|
102
102
|
|
103
|
-
|
|
103
|
+
| {8, 2} | 40 |
|
104
104
|
|
105
105
|
|
106
106
|
|
@@ -108,14 +108,14 @@
|
|
108
108
|
|
109
109
|
出力:
|
110
110
|
|
111
|
-
|
|
111
|
+
| 番号 | 点数 |
|
112
112
|
|
113
|
-
|
|
113
|
+
|:-------|-------:|
|
114
114
|
|
115
|
-
|
|
115
|
+
| {1} | 70 |
|
116
116
|
|
117
|
-
|
|
117
|
+
| {5} | 90 |
|
118
118
|
|
119
|
-
|
|
119
|
+
| {7} | 35 |
|
120
120
|
|
121
|
-
|
|
121
|
+
| {1, 7} | 30 |
|