题目:
Sum
Time Limit: 9000 MS Memory Limit: 65536 K
Sum
Mr. Jojer is given n numbers and an extra integer x, he wants to know whether there are two numbers whose sum is x.
Input
The input file contains several test cases. The first line of each test case contains two integers, n(<=1000001) and x. From the next line of each test case, there are n numbers.
Output
Each test case corresponds to a line in the output, which is either "YES" if there exists an answer or "NO" if not.
Sample Input
3 3 1 2 3 2 3 1 3
Sample Output
YES
NO
解题代码:
用空间换取时间