結果

問題 No.752 mod数列
ユーザー cielciel
提出日時 2018-11-11 09:32:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 754 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 11,436 KB
実行使用メモリ 33,308 KB
最終ジャッジ日時 2023-08-19 02:26:50
合計ジャッジ時間 19,675 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
15,424 KB
testcase_01 AC 148 ms
15,404 KB
testcase_02 AC 148 ms
15,532 KB
testcase_03 AC 145 ms
15,264 KB
testcase_04 AC 149 ms
15,388 KB
testcase_05 AC 144 ms
15,584 KB
testcase_06 AC 146 ms
15,520 KB
testcase_07 AC 148 ms
15,396 KB
testcase_08 AC 145 ms
15,404 KB
testcase_09 AC 143 ms
15,500 KB
testcase_10 AC 171 ms
23,516 KB
testcase_11 AC 162 ms
19,020 KB
testcase_12 AC 171 ms
22,580 KB
testcase_13 AC 162 ms
20,304 KB
testcase_14 AC 172 ms
23,548 KB
testcase_15 AC 609 ms
15,432 KB
testcase_16 AC 656 ms
18,408 KB
testcase_17 AC 750 ms
33,308 KB
testcase_18 AC 673 ms
20,312 KB
testcase_19 AC 687 ms
20,876 KB
testcase_20 AC 743 ms
25,528 KB
testcase_21 AC 740 ms
25,512 KB
testcase_22 AC 733 ms
25,500 KB
testcase_23 AC 754 ms
25,832 KB
testcase_24 AC 734 ms
25,460 KB
testcase_25 AC 338 ms
27,628 KB
testcase_26 AC 626 ms
32,352 KB
testcase_27 AC 502 ms
26,324 KB
testcase_28 AC 589 ms
31,860 KB
testcase_29 AC 697 ms
29,208 KB
testcase_30 AC 743 ms
30,144 KB
testcase_31 AC 145 ms
15,332 KB
testcase_32 AC 149 ms
15,336 KB
testcase_33 AC 159 ms
22,116 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

ENV[Z='RUBY_THREAD_VM_STACK_SIZE']||exec({Z=>?5*8},'ruby',$0)
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