結果

問題 No.715 集合と二人ゲーム
ユーザー gew1fw
提出日時 2025-06-12 18:15:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 455 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,268 KB
実行使用メモリ 154,752 KB
最終ジャッジ日時 2025-06-12 18:15:46
合計ジャッジ時間 6,840 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 32 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
a.sort()

xor = 0
current_length = 1

for i in range(1, n):
    if a[i] == a[i-1] + 1:
        current_length += 1
    else:
        # Calculate grundy for current group
        grundy = 1 if (current_length % 3 == 0) else 0
        xor ^= grundy
        current_length = 1

# Process the last group
grundy = 1 if (current_length % 3 == 0) else 0
xor ^= grundy

print("First" if xor != 0 else "Second")
0