結果

問題 No.1926 Sequence of Remainders
ユーザー ShirotsumeShirotsume
提出日時 2022-05-06 21:26:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 78,440 KB
最終ジャッジ日時 2023-09-20 02:16:20
合計ジャッジ時間 8,719 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,176 KB
testcase_01 AC 138 ms
78,440 KB
testcase_02 AC 140 ms
78,368 KB
testcase_03 AC 142 ms
78,420 KB
testcase_04 AC 136 ms
78,344 KB
testcase_05 AC 148 ms
78,336 KB
testcase_06 AC 159 ms
77,856 KB
testcase_07 AC 153 ms
77,980 KB
testcase_08 AC 148 ms
77,644 KB
testcase_09 AC 146 ms
77,992 KB
testcase_10 AC 142 ms
77,592 KB
testcase_11 AC 145 ms
77,788 KB
testcase_12 AC 143 ms
78,048 KB
testcase_13 AC 148 ms
77,980 KB
testcase_14 AC 148 ms
77,900 KB
testcase_15 AC 146 ms
77,924 KB
testcase_16 AC 142 ms
77,828 KB
testcase_17 AC 144 ms
77,588 KB
testcase_18 AC 143 ms
77,864 KB
testcase_19 AC 143 ms
77,888 KB
testcase_20 AC 143 ms
77,732 KB
testcase_21 AC 144 ms
77,960 KB
testcase_22 AC 142 ms
77,724 KB
testcase_23 AC 142 ms
77,884 KB
testcase_24 AC 146 ms
77,548 KB
testcase_25 AC 145 ms
77,724 KB
testcase_26 AC 146 ms
77,744 KB
testcase_27 AC 149 ms
77,912 KB
testcase_28 AC 156 ms
77,928 KB
testcase_29 AC 151 ms
77,968 KB
testcase_30 AC 152 ms
77,892 KB
testcase_31 AC 154 ms
77,728 KB
testcase_32 AC 154 ms
77,504 KB
testcase_33 AC 145 ms
77,764 KB
testcase_34 AC 146 ms
77,972 KB
testcase_35 AC 155 ms
77,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
INF = 2 ** 63 - 1
mod = 998244353
def solve():
    n, m, k = mi()
    now = m
    while now > m - n:
        k = k % now
        now = max(k, m - n)
    print(k % now)

for _ in range(ii()):
    solve()
0