結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 170 ms
16,496 KB
testcase_01 AC 173 ms
16,496 KB
testcase_02 AC 168 ms
16,488 KB
testcase_03 AC 168 ms
16,340 KB
testcase_04 AC 173 ms
16,340 KB
testcase_05 AC 173 ms
16,496 KB
testcase_06 AC 169 ms
16,496 KB
testcase_07 AC 170 ms
16,496 KB
testcase_08 AC 169 ms
16,496 KB
testcase_09 AC 172 ms
16,496 KB
testcase_10 AC 198 ms
24,628 KB
testcase_11 AC 184 ms
19,928 KB
testcase_12 AC 197 ms
23,524 KB
testcase_13 AC 190 ms
21,248 KB
testcase_14 AC 203 ms
24,740 KB
testcase_15 AC 667 ms
17,500 KB
testcase_16 AC 727 ms
20,384 KB
testcase_17 AC 839 ms
34,860 KB
testcase_18 AC 745 ms
21,928 KB
testcase_19 AC 776 ms
22,664 KB
testcase_20 AC 832 ms
27,164 KB
testcase_21 AC 842 ms
27,084 KB
testcase_22 AC 835 ms
26,948 KB
testcase_23 AC 849 ms
27,680 KB
testcase_24 AC 849 ms
27,228 KB
testcase_25 AC 389 ms
28,820 KB
testcase_26 AC 712 ms
33,600 KB
testcase_27 AC 565 ms
27,512 KB
testcase_28 AC 674 ms
33,324 KB
testcase_29 AC 798 ms
31,004 KB
testcase_30 AC 863 ms
31,476 KB
testcase_31 AC 169 ms
16,340 KB
testcase_32 AC 173 ms
16,340 KB
testcase_33 AC 190 ms
23,312 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

ENV[Z='RUBY_THREAD_VM_STACK_SIZE']||exec({Z=>?9*7},'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