結果

問題 No.752 mod数列
ユーザー cielciel
提出日時 2018-11-11 10:15:36
言語 Ruby
(3.3.0)
結果
AC  
実行時間 704 ms / 2,000 ms
コード長 184 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 11,196 KB
実行使用メモリ 33,896 KB
最終ジャッジ日時 2023-08-19 06:17:05
合計ジャッジ時間 16,841 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
外部呼び出し有り
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
15,496 KB
testcase_01 AC 135 ms
15,452 KB
testcase_02 AC 136 ms
15,468 KB
testcase_03 AC 134 ms
15,448 KB
testcase_04 AC 132 ms
15,384 KB
testcase_05 AC 134 ms
15,324 KB
testcase_06 AC 135 ms
15,436 KB
testcase_07 AC 134 ms
15,436 KB
testcase_08 AC 138 ms
15,528 KB
testcase_09 AC 133 ms
15,488 KB
testcase_10 AC 161 ms
23,472 KB
testcase_11 AC 156 ms
18,764 KB
testcase_12 AC 157 ms
22,380 KB
testcase_13 AC 157 ms
20,056 KB
testcase_14 AC 160 ms
23,828 KB
testcase_15 AC 555 ms
16,532 KB
testcase_16 AC 608 ms
19,192 KB
testcase_17 AC 674 ms
33,896 KB
testcase_18 AC 620 ms
20,980 KB
testcase_19 AC 628 ms
21,464 KB
testcase_20 AC 659 ms
25,964 KB
testcase_21 AC 674 ms
25,992 KB
testcase_22 AC 685 ms
25,948 KB
testcase_23 AC 704 ms
26,528 KB
testcase_24 AC 661 ms
26,028 KB
testcase_25 AC 313 ms
27,636 KB
testcase_26 AC 558 ms
32,700 KB
testcase_27 AC 446 ms
26,576 KB
testcase_28 AC 549 ms
32,172 KB
testcase_29 AC 686 ms
29,972 KB
testcase_30 AC 694 ms
30,304 KB
testcase_31 AC 143 ms
15,332 KB
testcase_32 AC 136 ms
15,232 KB
testcase_33 AC 152 ms
22,232 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(m=P/-~(P/n))+(P%n+P%-~m)*(n-m)/2 end
P=gets.to_i
$<.map{|e|l,r=e.split.map &:to_i;p C(r)-C(l-1)}
0