結果

問題 No.249 N言っちゃダメゲーム (2)
ユーザー tcltk
提出日時 2021-01-21 05:07:50
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 758 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 89,088 KB
最終ジャッジ日時 2024-12-24 02:47:00
合計ジャッジ時間 1,730 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other MLE * 3
権限があれば一括ダウンロードができます

ソースコード

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