結果

問題 No.1252 数字根D
ユーザー rlangevinrlangevin
提出日時 2023-01-25 22:49:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 201 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 78,576 KB
最終ジャッジ日時 2023-09-09 07:12:32
合計ジャッジ時間 3,214 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,300 KB
testcase_01 AC 72 ms
71,504 KB
testcase_02 AC 74 ms
71,264 KB
testcase_03 AC 95 ms
76,408 KB
testcase_04 AC 116 ms
78,412 KB
testcase_05 AC 114 ms
78,576 KB
testcase_06 AC 116 ms
78,344 KB
testcase_07 AC 117 ms
78,296 KB
testcase_08 AC 116 ms
78,492 KB
testcase_09 AC 115 ms
78,496 KB
testcase_10 AC 115 ms
78,336 KB
testcase_11 AC 115 ms
78,452 KB
testcase_12 AC 113 ms
78,420 KB
testcase_13 AC 115 ms
78,352 KB
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(a, d):
    q, r = divmod(a, 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(f(B, d) - f(A - 1, d))    
0