結果

問題 No.1252 数字根D
ユーザー 👑 KazunKazun
提出日時 2020-12-14 08:03:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 169 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,888 KB
実行使用メモリ 76,028 KB
最終ジャッジ日時 2023-10-20 04:46:47
合計ジャッジ時間 2,449 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,536 KB
testcase_01 AC 39 ms
53,536 KB
testcase_02 AC 40 ms
53,536 KB
testcase_03 AC 65 ms
68,268 KB
testcase_04 AC 88 ms
76,020 KB
testcase_05 AC 88 ms
76,024 KB
testcase_06 AC 90 ms
76,024 KB
testcase_07 AC 89 ms
76,028 KB
testcase_08 AC 88 ms
76,024 KB
testcase_09 AC 91 ms
76,020 KB
testcase_10 AC 88 ms
76,028 KB
testcase_11 AC 89 ms
76,024 KB
testcase_12 AC 88 ms
76,028 KB
testcase_13 AC 89 ms
76,024 KB
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def g(N,d):
    Q,R=divmod(N,d-1)
    return Q*(d*(d-1))//2+(R*(R+1))//2

T=int(input())
for _ in range(T):
    d,A,B=map(int,input().split())
    print(g(B,d)-g(A-1,d))
0