結果

問題 No.249 N言っちゃダメゲーム (2)
ユーザー GrayCoder
提出日時 2018-06-03 15:37:33
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 439 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,572 KB
最終ジャッジ日時 2024-06-30 09:23:00
合計ジャッジ時間 1,024 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 1 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

def main():
    NK = stdin.read().splitlines()

    players = ['you', 'grant']
    points = {'you': 0, 'grant': 0}
    for i, s in enumerate(NK):
        n, k = map(int, s.split())
        if i > 0 and n % k != 1:
            players[0], players[1] = players[1], players[0]
        if n % k == 1:
            points[players[0]] += 1
        else:
            points[players[1]] += 1
    print(points['you'])

main()
0