結果

問題 No.249 N言っちゃダメゲーム (2)
ユーザー GrayCoderGrayCoder
提出日時 2018-06-03 15:37:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 439 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 16,016 KB
最終ジャッジ日時 2023-09-12 21:53:21
合計ジャッジ時間 761 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

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