結果
| 問題 | 
                            No.1208 anti primenumber game
                             | 
                    
| コンテスト | |
| ユーザー | 
                             lam6er
                         | 
                    
| 提出日時 | 2025-04-15 22:02:24 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,044 bytes | 
| コンパイル時間 | 246 ms | 
| コンパイル使用メモリ | 81,784 KB | 
| 実行使用メモリ | 121,712 KB | 
| 最終ジャッジ日時 | 2025-04-15 22:03:35 | 
| 合計ジャッジ時間 | 4,904 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 33 WA * 11 | 
ソースコード
def main():
    import sys
    input = sys.stdin.read().split()
    idx = 0
    N = int(input[idx])
    idx += 1
    M = int(input[idx])
    idx += 1
    A = list(map(int, input[idx:idx+N]))
    
    current_starting_player = True  # True for First, False for Second
    total_diff = 0
    
    for a in A:
        if a == 1:
            if current_starting_player:
                contribution = 1 - M
            else:
                contribution = M - 1
            moves = 1
        else:
            take_all = a - M
            take_almost = (a - 2) + M
            V = max(take_all, take_almost)
            if current_starting_player:
                contribution = V
            else:
                contribution = -V
            moves = 1 if V == take_all else 2
        
        total_diff += contribution
        
        if moves % 2 == 1:
            current_starting_player = not current_starting_player
    
    if total_diff > 0:
        print("First")
    else:
        print("Second")
if __name__ == "__main__":
    main()
            
            
            
        
            
lam6er