回答編集履歴

1

コードの修正

2020/10/15 23:34

投稿

退会済みユーザー
test CHANGED
@@ -64,9 +64,9 @@
64
64
 
65
65
  res.append((k+n, len(v[1])+1, sorted(v[1]+[n])))
66
66
 
67
- elif k+n not in status or status[k+n][0] > v[0]+1:
67
+ elif k+n not in status or status[k+n] > (v[0]+1, v[1]+[n]):
68
-
68
+
69
- u[k+n] = (v[0]+1, v[1]+[n])
69
+ u[k+n] = (v[0]+1, sorted(v[1]+[n]))
70
70
 
71
71
  status.update(u)
72
72
 
@@ -116,15 +116,17 @@
116
116
 
117
117
  [497, 277, 767, 980, 144, 36, 970, 541, 489, 402, 973, 985, 823, 318, 484, 320,
118
118
 
119
- 1081, 808, 41, 141, 336, 97, 626, 73, 561, 978, 803, 884, 818, 920, 284, 758, 209,
119
+ 1081, 808, 41, 141, 336, 97, 626, 73, 561, 978, 803, 884, 818, 920, 284, 758, 20
120
-
120
+
121
- 83, 288, 1023, 454, 538, 903, 626, 872, 1048, 800, 728, 844, 485, 699, 68, 582,
121
+ 9, 83, 288, 1023, 454, 538, 903, 626, 872, 1048, 800, 728, 844, 485, 699, 68, 58
122
-
122
+
123
- 344, 678, 223, 442, 556, 593, 264, 139, 997, 1000, 191, 714, 146, 850, 318, 51,
123
+ 2, 344, 678, 223, 442, 556, 593, 264, 139, 997, 1000, 191, 714, 146, 850, 318, 5
124
-
124
+
125
- 611, 884, 860, 253, 100, 102, 783, 687, 581, 1045, 493, 83, 644, 24, 167, 231,
125
+ 1, 611, 884, 860, 253, 100, 102, 783, 687, 581, 1045, 493, 83, 644, 24, 167, 231
126
-
126
+
127
- 74, 414, 845, 607, 549, 329, 96, 705, 652, 747, 293, 783, 781, 952, 1075, 800, 220, 1048, 565]
127
+ , 74, 414, 845, 607, 549, 329, 96, 705, 652, 747, 293, 783, 781, 952, 1075, 800,
128
+
129
+ 220, 1048, 565]
128
130
 
129
131
 
130
132
 
@@ -150,33 +152,31 @@
150
152
 
151
153
  [83, 336, 581], (1000)
152
154
 
155
+ [100, 293, 607], (1000)
156
+
153
157
  [102, 220, 678], (1000)
154
158
 
155
159
  [139, 320, 541], (1000)
156
160
 
157
161
  [144, 318, 538], (1000)
158
162
 
159
- [167, 277, 556], (1000)
163
+ [146, 167, 687], (1000)
160
164
 
161
165
  [223, 284, 493], (1000)
162
166
 
163
- [146, 293, 561], (1000)
167
+ [442, 561], (1003)
164
168
 
165
169
  [454, 549], (1003)
166
170
 
167
- [100, 414, 489], (1003)
168
-
169
- [318, 687], (1005)
170
-
171
- [442, 565], (1007)
171
+ [414, 593], (1007)
172
+
172
-
173
+ [96, 264, 318, 329], (1007)
174
+
173
- [402, 607], (1009)
175
+ [402, 611], (1013)
174
-
175
- [96, 264, 652], (1012)
176
176
 
177
177
  [1023], (1023)
178
178
 
179
- [329, 699], (1028)
179
+ [484, 556], (1040)
180
180
 
181
181
  [1045], (1045)
182
182
 
@@ -184,19 +184,21 @@
184
184
 
185
185
  [1048], (1048)
186
186
 
187
+ [485, 565], (1050)
188
+
189
+ [277, 781], (1058)
190
+
187
191
  [1075], (1075)
188
192
 
189
- [484, 593], (1077)
190
-
191
193
  [1081], (1081)
192
194
 
193
- [485, 611], (1096)
195
+ [489, 626], (1115)
194
196
 
195
197
  [497, 626], (1123)
196
198
 
197
- [626, 705], (1331)
199
+ [652, 699], (1351)
198
-
200
+
199
- [714, 781], (1495)
201
+ [705, 714], (1419)
200
202
 
201
203
  [783, 783], (1566)
202
204
 
@@ -218,6 +220,6 @@
218
220
 
219
221
  [980, 985], (1965)
220
222
 
221
- 残り:[997]
223
+ 残り:[997], (997)
222
224
 
223
225
  ```