回答編集履歴

1

コードの修正

2021/11/05 08:03

投稿

kazuma-s
kazuma-s

スコア8224

test CHANGED
@@ -32,17 +32,15 @@
32
32
 
33
33
  pivot = a[last]
34
34
 
35
- i = first - 1
35
+ i = first
36
36
 
37
37
  for j in range(first, last):
38
38
 
39
39
  if a[j] <= pivot:
40
40
 
41
- i += 1
42
-
43
41
  a[i], a[j] = a[j], a[i]
44
42
 
45
- i += 1
43
+ i += 1
46
44
 
47
45
  a[i], a[last] = a[last], a[i]
48
46