結果

問題 No.752 mod数列
ユーザー cielciel
提出日時 2018-11-11 09:45:27
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 142 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 11,488 KB
実行使用メモリ 25,924 KB
最終ジャッジ日時 2023-08-19 03:09:01
合計ジャッジ時間 9,666 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
15,304 KB
testcase_01 AC 75 ms
15,324 KB
testcase_02 AC 71 ms
15,576 KB
testcase_03 AC 73 ms
15,252 KB
testcase_04 AC 72 ms
15,164 KB
testcase_05 AC 69 ms
15,408 KB
testcase_06 AC 67 ms
15,428 KB
testcase_07 AC 69 ms
15,320 KB
testcase_08 AC 68 ms
15,536 KB
testcase_09 AC 67 ms
15,348 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 491 ms
15,308 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 539 ms
20,436 KB
testcase_19 AC 556 ms
20,844 KB
testcase_20 AC 598 ms
25,668 KB
testcase_21 AC 588 ms
25,724 KB
testcase_22 AC 622 ms
25,368 KB
testcase_23 AC 616 ms
25,924 KB
testcase_24 AC 628 ms
25,680 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 73 ms
15,164 KB
testcase_32 AC 72 ms
15,256 KB
testcase_33 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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