結果

問題 No.1926 Sequence of Remainders
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-05-06 22:25:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 368 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 964 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 79,072 KB
最終ジャッジ日時 2023-09-20 03:23:56
合計ジャッジ時間 16,481 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,664 KB
testcase_01 AC 341 ms
78,832 KB
testcase_02 AC 336 ms
78,640 KB
testcase_03 AC 350 ms
78,908 KB
testcase_04 AC 341 ms
78,872 KB
testcase_05 AC 337 ms
78,840 KB
testcase_06 AC 355 ms
78,560 KB
testcase_07 AC 351 ms
78,864 KB
testcase_08 AC 344 ms
78,812 KB
testcase_09 AC 352 ms
78,624 KB
testcase_10 AC 341 ms
78,832 KB
testcase_11 AC 346 ms
78,648 KB
testcase_12 AC 344 ms
78,648 KB
testcase_13 AC 358 ms
78,768 KB
testcase_14 AC 345 ms
78,624 KB
testcase_15 AC 351 ms
78,888 KB
testcase_16 AC 359 ms
78,568 KB
testcase_17 AC 347 ms
78,720 KB
testcase_18 AC 359 ms
78,912 KB
testcase_19 AC 355 ms
78,384 KB
testcase_20 AC 345 ms
78,716 KB
testcase_21 AC 348 ms
78,616 KB
testcase_22 AC 349 ms
78,912 KB
testcase_23 AC 345 ms
78,820 KB
testcase_24 AC 346 ms
78,700 KB
testcase_25 AC 341 ms
78,676 KB
testcase_26 AC 348 ms
78,888 KB
testcase_27 AC 353 ms
78,796 KB
testcase_28 AC 353 ms
78,832 KB
testcase_29 AC 359 ms
78,772 KB
testcase_30 AC 349 ms
78,752 KB
testcase_31 AC 346 ms
78,808 KB
testcase_32 AC 358 ms
78,744 KB
testcase_33 AC 368 ms
78,796 KB
testcase_34 AC 345 ms
79,072 KB
testcase_35 AC 350 ms
78,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n,m,k = map(int,input().split())
    now = k%m
    nn = 0
    while nn < n:
        nn += 1
        nm = m-nn
        if nm <= now:
            now %= nm
        else:
            dif = nm-now
            nn += dif-1
    return now

t = int(input())
for _ in range(t):
    print(solve())
0