質問編集履歴
1
エラーの内容を追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,17 +18,13 @@
|
|
18
18
|
|
19
19
|
```Python
|
20
20
|
|
21
|
-
# you can write to stdout for debugging purposes, e.g.
|
22
|
-
|
23
|
-
# print("this is a debug message")
|
24
|
-
|
25
|
-
|
26
|
-
|
27
21
|
def solution(A):
|
28
22
|
|
29
23
|
# write your code in Python 3.6
|
30
24
|
|
31
25
|
ans=0
|
26
|
+
|
27
|
+
pairs=[]
|
32
28
|
|
33
29
|
r=[[0 for j in range(2)] for i in range(len(A))]
|
34
30
|
|
@@ -50,23 +46,21 @@
|
|
50
46
|
|
51
47
|
for j in range(len(A)-1,i,-1):
|
52
48
|
|
49
|
+
#print("j=",j)
|
50
|
+
|
53
51
|
if R[j][0]<=maxr and R[j][0]>=minr:
|
54
52
|
|
55
|
-
|
53
|
+
pairs.append((j,i))
|
56
54
|
|
57
|
-
|
55
|
+
#print(len(pairs))
|
58
56
|
|
59
|
-
#print(when,R[j][0],R[j][1])
|
60
|
-
|
61
|
-
|
57
|
+
ans=len(pairs)
|
62
|
-
|
63
|
-
break
|
64
|
-
|
65
|
-
|
66
58
|
|
67
59
|
if ans>10000000:
|
68
60
|
|
69
61
|
return -1
|
62
|
+
|
63
|
+
#print(len(pairs))
|
70
64
|
|
71
65
|
return ans
|
72
66
|
|
@@ -76,4 +70,4 @@
|
|
76
70
|
|
77
71
|
|
78
72
|
|
79
|
-
|
73
|
+
N^2でタイムオーバーになります。教えていただけませんか?
|