QOJ.ac

QOJ

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

#963. 소수 제거하기

Statistics

두 명의 플레이어가 양의 정수로 이루어진 배열을 사용하여 게임을 합니다. 두 플레이어는 번갈아 가며 수를 두며, 수를 둘 수 없는 플레이어가 패배합니다. 한 번의 차례에 플레이어는 소수 $p$와 배열의 비어 있지 않은 구간 $[l; r]$을 선택해야 합니다. 이때 해당 구간의 모든 수는 $p$로 나누어떨어져야 하며, 그 후 구간 내의 모든 수에서 $p$의 모든 인수를 제거합니다. 인수를 제거한다는 것은 어떤 수를 $p$로 나누어떨어지지 않을 때까지 계속해서 나누는 것을 의미합니다.

두 플레이어가 최적으로 게임을 진행할 때, 누가 승리하는지 결정하십시오.

입력

첫 번째 줄에는 배열의 크기인 정수 $n$ ($1 \le n \le 1000$)이 주어집니다. 두 번째 줄에는 정수 배열 $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^{18}$)이 주어집니다.

출력

첫 번째 플레이어가 승리하면 "First"를, 그렇지 않으면 "Second"를 (따옴표 제외) 출력하십시오.

예제

예제 1

3
2 8 4

출력 1

First

예제 2

3
2 12 3

출력 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.