Phone Number 2010年山东省第一届ACM大学生程序设计竞赛

作者: jlhy8001 分类: 未分类 发布时间: 2014-10-25 11:32 阅读: 2,530


Phone Number


Time Limit: 1000MS Memory limit: 65536K

题目描述

We
know that if a phone number A is another phone number B’s prefix, B is not able to be called. For an example, A is 123 while B is 12345, after pressing 123, we call A, and not able to call B.

Given
N phone numbers, your task is to find whether there exits two numbers A and B that A is B’s prefix.



输入

 The
input consists of several test cases.

 The first
line of input in each test case contains one integer N (0<N<1001),
represent the number of phone numbers.

 The
next line contains N integers, describing the phone numbers.

 The
last case is followed by a line containing one zero.

输出

 For
each test case, if there exits a phone number that cannot be called, print “NO”, otherwise print “YES” instead.

示例输入

示例输出


This article is automatically posted by WP-AutoPost : WordPress自动采集发布插件
如何设置CSS选择器,WP-AutoPost

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注