結果

問題 No.752 mod数列
ユーザー cielciel
提出日時 2018-11-11 09:12:16
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 151 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 11,220 KB
実行使用メモリ 25,940 KB
最終ジャッジ日時 2023-08-18 22:43:04
合計ジャッジ時間 10,384 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
15,396 KB
testcase_01 AC 79 ms
15,524 KB
testcase_02 AC 71 ms
15,408 KB
testcase_03 AC 70 ms
15,372 KB
testcase_04 AC 68 ms
15,212 KB
testcase_05 AC 68 ms
15,608 KB
testcase_06 AC 66 ms
15,368 KB
testcase_07 AC 68 ms
15,288 KB
testcase_08 AC 69 ms
15,368 KB
testcase_09 AC 69 ms
15,464 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 502 ms
15,392 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 539 ms
20,508 KB
testcase_19 AC 545 ms
21,084 KB
testcase_20 AC 593 ms
25,524 KB
testcase_21 AC 575 ms
25,708 KB
testcase_22 AC 598 ms
25,364 KB
testcase_23 AC 593 ms
25,940 KB
testcase_24 AC 591 ms
25,676 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 68 ms
15,124 KB
testcase_32 AC 68 ms
15,072 KB
testcase_33 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

M={0=>0}
def K(o,n)
M[n]||=K(o,-1+x=o/(o/n+1)+1)+(o%n+o%x)*(n-x+1)/2
end
o,q=gets.split.map &:to_i
q.times{l,r=gets.split.map &:to_i;p K(o,r)-K(o,l-1)}
0