Starting position list a,
End position list b
When starting position list a take the ith a element,
In the end position list b finds the first list is greater than the starting position of the ith element
If this element (end position list b the first list is greater than the starting position take the ith element element) - starting position list the ith element & gt; 100
Orf + 1
CodePudding user response:
import random
A=[]
B=[]
For I in range (1101) :
A.a ppend (random randint (1300))
B.a ppend (random randint (1300))
Print (a)
Print (b)
C=[]
Orf=0
For I, d1 enumerate in (a) :
For j, enumerate in d2 (b) :
If d1 + 100 & lt; D2:
C.a. ppend ((I, j, d1, d2))
Orf +=1
Break
Print (c)
Print (orf)