QOJ.ac

QOJ

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

#973. Dãy số hợp số

Statistics

Một dãy số nguyên dương $S$ được gọi là một dãy hợp số (composite sequence) khi và chỉ khi tồn tại một dãy con khác rỗng $T$ của $S$ sao cho tổng các số nguyên trong $T$ là một hợp số.

Cho dãy $S$, nhiệm vụ của bạn là kiểm tra xem $S$ có phải là một dãy hợp số hay không.

Lưu ý rằng $1$ không phải là một hợp số.

Nhắc lại rằng $T$ là một dãy con của $S$ khi và chỉ khi ta có thể thu được $T$ bằng cách loại bỏ một số phần tử của $S$ (có thể không loại bỏ phần tử nào hoặc loại bỏ tất cả).

Dữ liệu vào

Dòng đầu tiên chứa một số nguyên $n$ ($1 \le n \le 10^5$), kích thước của $S$.

Dòng thứ hai chứa $n$ số nguyên $S_1, S_2, \dots, S_n$: các phần tử của $S$ ($1 \le S_i \le 10^9$).

Dữ liệu ra

Nếu $S$ là một dãy hợp số, in ra "Yes". Ngược lại, in ra "No".

Ví dụ

Dữ liệu vào 1

2
5 7

Dữ liệu ra 1

Yes

Dữ liệu vào 2

1
97

Dữ liệu ra 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.