結果

問題 No.810 割った余りの個数
ユーザー miya145592miya145592
提出日時 2023-05-27 17:15:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 165 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 71,596 KB
最終ジャッジ日時 2023-08-26 22:28:24
合計ジャッジ時間 4,008 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,192 KB
testcase_01 AC 68 ms
71,132 KB
testcase_02 AC 65 ms
71,568 KB
testcase_03 AC 68 ms
71,596 KB
testcase_04 AC 66 ms
71,584 KB
testcase_05 AC 68 ms
71,564 KB
testcase_06 AC 68 ms
71,384 KB
testcase_07 AC 66 ms
71,384 KB
testcase_08 AC 67 ms
71,308 KB
testcase_09 AC 67 ms
71,484 KB
testcase_10 AC 68 ms
71,460 KB
testcase_11 AC 68 ms
71,124 KB
testcase_12 AC 69 ms
71,468 KB
testcase_13 AC 68 ms
71,268 KB
testcase_14 AC 70 ms
71,580 KB
testcase_15 AC 67 ms
71,340 KB
testcase_16 AC 67 ms
71,336 KB
testcase_17 AC 67 ms
71,388 KB
testcase_18 AC 67 ms
71,340 KB
testcase_19 AC 69 ms
71,268 KB
testcase_20 AC 68 ms
71,128 KB
testcase_21 AC 69 ms
71,432 KB
testcase_22 AC 67 ms
71,476 KB
testcase_23 AC 70 ms
71,420 KB
testcase_24 AC 69 ms
71,468 KB
testcase_25 AC 69 ms
71,348 KB
testcase_26 AC 67 ms
71,264 KB
testcase_27 AC 67 ms
71,272 KB
testcase_28 AC 68 ms
71,268 KB
testcase_29 AC 68 ms
71,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L, R, M = map(int, input().split())
if R-L+1>=M:
    print(M)
else:
    l = L%M
    r = R%M
    if l<=r:
        print(r-l+1)
    else:
        print(M-1-l+1 + r+1)
0