結果
問題 |
No.715 集合と二人ゲーム
|
ユーザー |
![]() |
提出日時 | 2025-06-12 20:32:12 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 819 bytes |
コンパイル時間 | 255 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 171,008 KB |
最終ジャッジ日時 | 2025-06-12 20:33:32 |
合計ジャッジ時間 | 7,389 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 WA * 29 |
ソースコード
def main(): import sys input = sys.stdin.read().split() N = int(input[0]) A = list(map(int, input[1:N+1])) A.sort() groups = [] if N == 0: print("Second") return current = A[0] count = 1 for i in range(1, N): if A[i] == A[i-1] + 1: count += 1 else: groups.append(count) current = A[i] count = 1 groups.append(count) xor = 0 for m in groups: if m == 0: continue if m == 1: xor ^= 1 elif m == 2: xor ^= 1 else: idx = (m - 3) % 5 g = [2, 0, 3, 1, 1][idx] xor ^= g if xor != 0: print("First") else: print("Second") if __name__ == "__main__": main()