結果

問題 No.752 mod数列
ユーザー cielciel
提出日時 2020-02-08 19:27:51
言語 Crystal
(1.11.2)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 173 bytes
コンパイル時間 20,409 ms
コンパイル使用メモリ 262,072 KB
実行使用メモリ 21,608 KB
最終ジャッジ日時 2023-09-13 10:12:07
合計ジャッジ時間 25,038 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,640 KB
testcase_01 AC 3 ms
4,644 KB
testcase_02 AC 3 ms
4,720 KB
testcase_03 AC 3 ms
4,544 KB
testcase_04 AC 3 ms
4,524 KB
testcase_05 AC 3 ms
4,656 KB
testcase_06 AC 3 ms
4,680 KB
testcase_07 AC 3 ms
4,692 KB
testcase_08 AC 3 ms
4,600 KB
testcase_09 AC 3 ms
4,780 KB
testcase_10 AC 13 ms
9,296 KB
testcase_11 AC 8 ms
6,932 KB
testcase_12 AC 11 ms
8,844 KB
testcase_13 AC 10 ms
7,544 KB
testcase_14 AC 13 ms
9,536 KB
testcase_15 AC 158 ms
5,204 KB
testcase_16 AC 178 ms
7,068 KB
testcase_17 AC 222 ms
21,608 KB
testcase_18 AC 184 ms
11,328 KB
testcase_19 AC 190 ms
12,388 KB
testcase_20 AC 209 ms
19,296 KB
testcase_21 AC 209 ms
19,036 KB
testcase_22 AC 207 ms
19,096 KB
testcase_23 AC 211 ms
18,132 KB
testcase_24 AC 212 ms
19,104 KB
testcase_25 AC 72 ms
14,296 KB
testcase_26 AC 175 ms
21,108 KB
testcase_27 AC 124 ms
14,040 KB
testcase_28 AC 162 ms
20,732 KB
testcase_29 AC 201 ms
19,068 KB
testcase_30 AC 220 ms
20,168 KB
testcase_31 AC 3 ms
4,544 KB
testcase_32 AC 3 ms
4,464 KB
testcase_33 AC 10 ms
8,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M={0=>0_i64}
def c(o,n);M[n]||=c(o,0+(m=o//-~(o//n)))+(o%n+o%-~m)*(n-m)//2 end
o=gets.not_nil!.split[0].to_i64
ARGF.each_line{|e|l,r=e.split.map &.to_i;puts c(o,r)-c(o,l-1)}
0