QOJ.ac

QOJ

Límite de tiempo: 5 s Límite de memoria: 256 MB Puntuación total: 100

#963. Loại bỏ số nguyên tố

Estadísticas

Hai người chơi tham gia một trò chơi với một mảng các số nguyên dương. Họ thực hiện các lượt chơi luân phiên, người chơi nào không thể thực hiện lượt đi sẽ thua. Trong một lượt, bạn phải chọn một số nguyên tố $p$ và một đoạn $[l; r]$ không rỗng của mảng sao cho tất cả các số trong đoạn này đều chia hết cho $p$, sau đó loại bỏ tất cả các thừa số $p$ khỏi mỗi số đó. Việc loại bỏ tất cả các thừa số có nghĩa là chúng ta lấy một số và chia nó cho $p$ cho đến khi nó không còn chia hết cho $p$ được nữa.

Xác định ai là người thắng cuộc nếu cả hai người chơi đều chơi tối ưu.

Dữ liệu vào

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

Dòng thứ hai chứa mảng các số nguyên $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^{18}$).

Dữ liệu ra

In ra "First" (không có dấu ngoặc kép) nếu người chơi thứ nhất thắng và "Second" (không có dấu ngoặc kép) nếu ngược lại.

Ví dụ

Dữ liệu vào 1

3
2 8 4

Dữ liệu ra 1

First

Dữ liệu vào 2

3
2 12 3

Dữ liệu ra 2

Second

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.