結果
問題 |
No.715 集合と二人ゲーム
|
ユーザー |
![]() |
提出日時 | 2025-04-16 15:37:58 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 492 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 81,544 KB |
実行使用メモリ | 193,088 KB |
最終ジャッジ日時 | 2025-04-16 15:43:22 |
合計ジャッジ時間 | 6,337 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 WA * 29 |
ソースコード
n = int(input()) a = list(map(int, input().split())) a.sort() if n == 0: print("Second") exit() groups = [] current = [a[0]] for num in a[1:]: if num - current[-1] <= 1: current.append(num) else: groups.append(len(current)) current = [num] groups.append(len(current)) xor_sum = 0 for length in groups: if length == 1 or length == 2: xor_sum ^= 1 else: xor_sum ^= (length - 2) % 2 print("First" if xor_sum != 0 else "Second")