Login
Register
Problem list
Online status
JiaweiPeng
:
2024-01-03 00:05:09
def has_pair_with_sum(arr, x): seen = set() for num in arr: if x - num in seen: return "yes" seen.add(num) return "no" m = int(input()) for _ in range(m): n, x = map(int, input().split()) arr = list(map(int, input().split())) print(has_pair_with_sum(arr, x))
User01
:
2020-11-02 10:54:12
Syntactic requirements?
Post Your Comment