QOJ.ac

QOJ

時間限制: 5 s 記憶體限制: 256 MB 總分: 100

#963. 素数の削除

统计

2人のプレイヤーが正の整数の配列を使ってゲームを行います。プレイヤーは交互に手番を行い、手番を行えなくなったプレイヤーが負けとなります。1手番において、プレイヤーは素数 $p$ と、その区間内のすべての数が $p$ で割り切れるような空でない区間 $[l; r]$ を選び、その区間内の各数から $p$ の因数をすべて取り除かなければなりません。因数をすべて取り除くとは、ある数に対して、$p$ で割り切れる限りその数で割り続けることを意味します。

両者が最適に行動すると仮定したとき、どちらが勝つか判定してください。

入力

1行目には整数 $n$ ($1 \le n \le 1000$) が与えられます。これは配列のサイズです。 2行目には配列の各要素 $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.