質問編集履歴
2
エラーの部分を編集しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -58,20 +58,22 @@
|
|
58
58
|
|
59
59
|
```python
|
60
60
|
|
61
|
-
|
61
|
+
38 else:
|
62
|
-
|
62
|
+
|
63
|
-
3
|
63
|
+
39 for i in range(0,len(eva),1):
|
64
|
-
|
64
|
+
|
65
|
-
--->
|
65
|
+
---> 40 if eva[i] < eva[i+1]:
|
66
|
-
|
66
|
+
|
67
|
-
4
|
67
|
+
41 tournament.append(eva[i])
|
68
|
-
|
68
|
+
|
69
|
-
4
|
69
|
+
42 else:
|
70
70
|
|
71
71
|
|
72
72
|
|
73
73
|
IndexError: list index out of range
|
74
74
|
|
75
|
+
|
76
|
+
|
75
77
|
```
|
76
78
|
|
77
79
|
|
1
質問内容を変更した
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,42 +16,40 @@
|
|
16
16
|
|
17
17
|
random.shuffle(eva)
|
18
18
|
|
19
|
-
tournament =
|
19
|
+
tournament = [()]
|
20
|
-
|
20
|
+
|
21
|
-
while len(
|
21
|
+
while len(eva) > 1:
|
22
|
-
|
22
|
+
|
23
|
-
if len(
|
23
|
+
if len(eva) % 2 != 0:
|
24
|
-
|
24
|
+
|
25
|
-
for i in range(1,len(
|
25
|
+
for i in range(1,len(eva),1):
|
26
|
-
|
26
|
+
|
27
|
-
if
|
27
|
+
if eva[i] < eva[i+1]:
|
28
|
-
|
28
|
+
|
29
|
-
|
29
|
+
tournament.append(eva[i])
|
30
30
|
|
31
31
|
else:
|
32
32
|
|
33
|
+
tournament.append(eva[i+1])
|
34
|
+
|
33
|
-
|
35
|
+
eva = tournament
|
34
36
|
|
35
37
|
else:
|
36
38
|
|
37
|
-
for i in range(0,len(
|
39
|
+
for i in range(0,len(eva),1):
|
38
|
-
|
40
|
+
|
39
|
-
if
|
41
|
+
if eva[i] < eva[i+1]:
|
40
|
-
|
42
|
+
|
41
|
-
|
43
|
+
tournament.append(eva[i])
|
42
44
|
|
43
45
|
else:
|
44
46
|
|
47
|
+
tournament.append(eva[i+1])
|
48
|
+
|
45
|
-
|
49
|
+
eva = tournament
|
46
|
-
|
47
|
-
|
48
50
|
|
49
51
|
return tournament
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
53
|
```
|
56
54
|
|
57
55
|
|
@@ -156,35 +154,37 @@
|
|
156
154
|
|
157
155
|
random.shuffle(eva)
|
158
156
|
|
159
|
-
tournament =
|
157
|
+
tournament = [()]
|
160
|
-
|
158
|
+
|
161
|
-
while len(
|
159
|
+
while len(eva) > 1:
|
162
|
-
|
160
|
+
|
163
|
-
if len(
|
161
|
+
if len(eva) % 2 != 0:
|
164
|
-
|
162
|
+
|
165
|
-
for i in range(1,len(
|
163
|
+
for i in range(1,len(eva),1):
|
166
|
-
|
164
|
+
|
167
|
-
if
|
165
|
+
if eva[i] < eva[i+1]:
|
168
|
-
|
166
|
+
|
169
|
-
|
167
|
+
tournament.append(eva[i])
|
170
168
|
|
171
169
|
else:
|
172
170
|
|
171
|
+
tournament.append(eva[i+1])
|
172
|
+
|
173
|
-
|
173
|
+
eva = tournament
|
174
174
|
|
175
175
|
else:
|
176
176
|
|
177
|
-
for i in range(0,len(
|
177
|
+
for i in range(0,len(eva),1):
|
178
|
-
|
178
|
+
|
179
|
-
if
|
179
|
+
if eva[i] < eva[i+1]:
|
180
|
-
|
180
|
+
|
181
|
-
|
181
|
+
tournament.append(eva[i])
|
182
182
|
|
183
183
|
else:
|
184
184
|
|
185
|
+
tournament.append(eva[i+1])
|
186
|
+
|
185
|
-
|
187
|
+
eva = tournament
|
186
|
-
|
187
|
-
|
188
188
|
|
189
189
|
return tournament
|
190
190
|
|