QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#973. 合数序列

Statistics

如果一个正整数序列 $S$ 存在一个非空子序列 $T$,使得 $T$ 中所有整数之和为一个合数,则称 $S$ 为合数序列。

给定序列 $S$,你的任务是判断 $S$ 是否为合数序列。

注意:$1$ 不是合数。

回想一下,$T$ 是 $S$ 的子序列,当且仅当可以通过从 $S$ 中删除某些元素(可能不删除或全部删除)得到 $T$。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 10^5$),表示 $S$ 的大小。

第二行包含 $n$ 个整数 $S_1, S_2, \dots, S_n$,表示 $S$ 的元素 ($1 \le S_i \le 10^9$)。

输出格式

如果 $S$ 是合数序列,输出 “Yes”。否则,输出 “No”。

样例

样例输入 1

2
5 7

样例输出 1

Yes

样例输入 2

1
97

样例输出 2

No

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.