結果
| 問題 | No.715 集合と二人ゲーム |
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 15:11:43 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 797 bytes |
| 記録 | |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 96,108 KB |
| 実行使用メモリ | 184,960 KB |
| 最終ジャッジ日時 | 2026-07-11 13:54:28 |
| 合計ジャッジ時間 | 8,091 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 WA * 31 |
ソースコード
def main():
import sys
input = sys.stdin.read().split()
n = int(input[0])
a = list(map(int, input[1:n+1]))
a.sort()
clusters = []
if not a:
print("Second")
return
current_start = a[0]
current_end = a[0]
for num in a[1:]:
if num == current_end + 1:
current_end = num
else:
clusters.append((current_start, current_end))
current_start = num
current_end = num
clusters.append((current_start, current_end))
count_odd = 0
for (s, e) in clusters:
size = e - s + 1
if size % 2 == 1:
count_odd += 1
if count_odd % 2 == 1:
print("First")
else:
print("Second")
if __name__ == "__main__":
main()
gew1fw