結果

問題 No.1252 数字根D
ユーザー googol_S0googol_S0
提出日時 2020-10-09 21:50:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 208 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 78,488 KB
最終ジャッジ日時 2023-09-27 16:22:51
合計ジャッジ時間 2,815 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,372 KB
testcase_01 AC 65 ms
71,324 KB
testcase_02 AC 66 ms
71,456 KB
testcase_03 AC 88 ms
76,300 KB
testcase_04 AC 115 ms
78,348 KB
testcase_05 AC 107 ms
78,336 KB
testcase_06 AC 105 ms
78,316 KB
testcase_07 AC 107 ms
78,316 KB
testcase_08 AC 102 ms
78,360 KB
testcase_09 AC 103 ms
78,488 KB
testcase_10 AC 118 ms
78,276 KB
testcase_11 AC 102 ms
78,036 KB
testcase_12 AC 103 ms
78,348 KB
testcase_13 AC 104 ms
78,392 KB
testcase_14 AC 63 ms
71,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
D,A,B,P=0,0,0,0
for i in range(T):
  D,A,B=map(int,input().split())
  D-=1
  A=max(0,A-1)
  P=(B//D)*D*(D+1)//2
  P+=(B%D)*((B%D)+1)//2
  P-=(A//D)*D*(D+1)//2
  P-=(A%D)*((A%D)+1)//2
  print(P)
0