コード例 #1
0
def solution_4_6(S1,S2,x):
    s2 = merge_sort(S2)
    low = 0
    for i in s1:
        if binary_search(s2,x-i,0,len(s2)):
            return (val,i)
    return -1:w
def solution(a, k):

    sorted_array = merge_sort(a)
    print sorted_array
    n = len(a)-1
    pairs = []
    for i in sorted_array:
        if binary_search(sorted_array,k+i,0,n) != -1:
            pairs.append((i,k+i))
    return pairs