結果
問題 |
No.1208 anti primenumber game
|
ユーザー |
![]() |
提出日時 | 2025-06-12 12:49:08 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 697 bytes |
コンパイル時間 | 197 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 108,032 KB |
最終ジャッジ日時 | 2025-06-12 12:49:14 |
合計ジャッジ時間 | 5,403 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 WA * 14 |
ソースコード
n, M = map(int, input().split()) A = list(map(int, input().split())) current_total = 0 current_player = True # True represents the first player for a in A: if a == 0: diff_original = 0 elif a == 1: diff_original = 1 - M else: option1 = a - M option2 = a - 2 + M diff_original = max(option1, option2) if current_player: diff = diff_original else: diff = -diff_original current_total += diff # Update the current player based on the original difference's sign if diff_original > 0: current_player = not current_player if current_total > 0: print("First") else: print("Second")