Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

一道让我痛不欲生的题目

Posted by hubo430 at 2005-04-26 14:33:18
各位计算机的高手们:
    你们好!
    在下最近碰到了一到很难的题(当然了,是相对于我这个小菜鸟而言 的),题目是这样的:
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


题目来自于四川安心在线评判(网址:http://acm.scu.edu.cn/online_judge/problem.do?problem=1627),希望哪位好心人能帮帮我啊,在下不胜感激

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator