F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Numbers

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/262144 K (Java/Others)
Total Submission(s): 2054    Accepted Submission(s): 1119


Problem Description
There are n numbers ${A}_{1},{A}_{2}....{A}_{n}$,your task is to check whether there exists there different positive integers i, j, k ($1\leq i , j , k \leq n$) such that ${A}_{i}-{A}_{j}={A}_{k}$
 

Input
There are multiple test cases, no more than 1000 cases.
First line of each case contains a single integer n.$(3\leq n\leq 100)$.
Next line contains n integers ${A}_{1},{A}_{2}....{A}_{n}$.$(0\leq {A}_{i}\leq 1000)$
 

Output
For each case output "YES" in a single line if you find such i, j, k, otherwise output "NO".
 

Sample Input
3 3 1 2 3 1 0 2 4 1 1 0 2
 

Sample Output
YES NO YES
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-24 18:04:18, Gzip enabled