結果

問題 No.249 N言っちゃダメゲーム (2)
ユーザー tcltktcltk
提出日時 2021-01-21 05:07:50
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 758 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 92,128 KB
最終ジャッジ日時 2023-08-25 17:21:17
合計ジャッジ時間 2,113 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#region Header
#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
from queue import PriorityQueue
import bisect
import heapq

def input():
    return sys.stdin.readline()[:-1]

sys.setrecursionlimit(1000000)
#endregion

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)



def main():
    n = 0
    first_move = True
    for _ in range(1000):
        N, K = map(int, input().split())
        if first_move:
            if (N-1) % (K-1) == 0:
                n += 1
                first_move = False
        else:
            if (N-1) % (K-1) != 0:
                n += 1
                first_move = True
    print(n)

if __name__ == '__main__':
    main()
0