結果

問題 No.1926 Sequence of Remainders
ユーザー dangodango
提出日時 2023-06-25 21:40:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 347 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 78,384 KB
最終ジャッジ日時 2023-09-15 11:46:56
合計ジャッジ時間 21,708 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,636 KB
testcase_01 AC 305 ms
77,520 KB
testcase_02 AC 306 ms
77,520 KB
testcase_03 AC 341 ms
78,144 KB
testcase_04 AC 338 ms
78,300 KB
testcase_05 AC 347 ms
78,012 KB
testcase_06 AC 331 ms
78,200 KB
testcase_07 AC 321 ms
77,260 KB
testcase_08 AC 324 ms
77,744 KB
testcase_09 AC 322 ms
77,468 KB
testcase_10 AC 332 ms
78,384 KB
testcase_11 AC 336 ms
77,580 KB
testcase_12 AC 326 ms
77,544 KB
testcase_13 AC 326 ms
77,608 KB
testcase_14 AC 322 ms
77,616 KB
testcase_15 AC 323 ms
77,564 KB
testcase_16 AC 324 ms
77,632 KB
testcase_17 AC 319 ms
77,648 KB
testcase_18 AC 339 ms
78,304 KB
testcase_19 AC 326 ms
77,520 KB
testcase_20 AC 329 ms
77,416 KB
testcase_21 AC 318 ms
77,516 KB
testcase_22 AC 321 ms
77,532 KB
testcase_23 AC 336 ms
78,328 KB
testcase_24 AC 323 ms
77,616 KB
testcase_25 AC 314 ms
77,620 KB
testcase_26 AC 335 ms
78,220 KB
testcase_27 AC 347 ms
77,892 KB
testcase_28 AC 346 ms
77,876 KB
testcase_29 AC 318 ms
77,568 KB
testcase_30 AC 334 ms
77,704 KB
testcase_31 AC 328 ms
78,272 KB
testcase_32 AC 319 ms
77,560 KB
testcase_33 AC 335 ms
78,060 KB
testcase_34 AC 343 ms
78,164 KB
testcase_35 AC 333 ms
77,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n, m, k = map(int, input().split())
    i = 1
    a = k % m
    while i <= n:
        if a < m - i:
            d = (m - i) - a
            i += d
        else:
            a = a % (m - i)
            i += 1
    print(a)
0