結果

問題 No.752 mod数列
ユーザー cielciel
提出日時 2020-02-08 19:20:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 842 ms / 2,000 ms
コード長 184 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 11,952 KB
実行使用メモリ 34,612 KB
最終ジャッジ日時 2023-10-26 03:11:41
合計ジャッジ時間 20,965 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 169 ms
16,588 KB
testcase_01 AC 166 ms
16,548 KB
testcase_02 AC 163 ms
16,588 KB
testcase_03 AC 163 ms
16,376 KB
testcase_04 AC 165 ms
16,328 KB
testcase_05 AC 167 ms
16,544 KB
testcase_06 AC 164 ms
16,588 KB
testcase_07 AC 163 ms
16,588 KB
testcase_08 AC 167 ms
16,588 KB
testcase_09 AC 169 ms
16,588 KB
testcase_10 AC 195 ms
24,708 KB
testcase_11 AC 186 ms
20,020 KB
testcase_12 AC 190 ms
23,604 KB
testcase_13 AC 182 ms
21,204 KB
testcase_14 AC 196 ms
24,812 KB
testcase_15 AC 663 ms
17,488 KB
testcase_16 AC 701 ms
20,452 KB
testcase_17 AC 813 ms
34,612 KB
testcase_18 AC 735 ms
22,004 KB
testcase_19 AC 750 ms
22,716 KB
testcase_20 AC 812 ms
27,224 KB
testcase_21 AC 821 ms
27,132 KB
testcase_22 AC 812 ms
26,988 KB
testcase_23 AC 817 ms
27,644 KB
testcase_24 AC 832 ms
27,196 KB
testcase_25 AC 377 ms
28,824 KB
testcase_26 AC 697 ms
33,640 KB
testcase_27 AC 531 ms
27,516 KB
testcase_28 AC 654 ms
33,328 KB
testcase_29 AC 776 ms
31,036 KB
testcase_30 AC 842 ms
31,440 KB
testcase_31 AC 170 ms
16,328 KB
testcase_32 AC 165 ms
16,328 KB
testcase_33 AC 185 ms
23,388 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