結果

問題 No.752 mod数列
ユーザー cielciel
提出日時 2020-08-14 01:43:51
言語 Crystal
(1.11.2)
結果
AC  
実行時間 218 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 19,087 ms
コンパイル使用メモリ 261,088 KB
実行使用メモリ 21,628 KB
最終ジャッジ日時 2023-09-13 11:43:02
合計ジャッジ時間 24,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,528 KB
testcase_01 AC 3 ms
4,536 KB
testcase_02 AC 3 ms
4,680 KB
testcase_03 AC 2 ms
4,568 KB
testcase_04 AC 3 ms
4,424 KB
testcase_05 AC 3 ms
4,644 KB
testcase_06 AC 3 ms
4,496 KB
testcase_07 AC 3 ms
4,548 KB
testcase_08 AC 3 ms
4,632 KB
testcase_09 AC 2 ms
4,520 KB
testcase_10 AC 13 ms
9,332 KB
testcase_11 AC 8 ms
6,956 KB
testcase_12 AC 11 ms
8,756 KB
testcase_13 AC 9 ms
7,324 KB
testcase_14 AC 12 ms
9,580 KB
testcase_15 AC 154 ms
5,056 KB
testcase_16 AC 172 ms
7,044 KB
testcase_17 AC 216 ms
21,628 KB
testcase_18 AC 179 ms
12,124 KB
testcase_19 AC 187 ms
11,868 KB
testcase_20 AC 205 ms
19,120 KB
testcase_21 AC 209 ms
19,088 KB
testcase_22 AC 207 ms
19,180 KB
testcase_23 AC 208 ms
18,036 KB
testcase_24 AC 207 ms
17,952 KB
testcase_25 AC 71 ms
14,532 KB
testcase_26 AC 172 ms
21,120 KB
testcase_27 AC 122 ms
13,948 KB
testcase_28 AC 160 ms
20,768 KB
testcase_29 AC 203 ms
17,952 KB
testcase_30 AC 218 ms
20,076 KB
testcase_31 AC 3 ms
4,444 KB
testcase_32 AC 3 ms
4,380 KB
testcase_33 AC 10 ms
8,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

lib C;fun strtoll(s: UInt8*,p: UInt8*,b: Int32): Int64;end
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=C.strtoll(gets.not_nil!.split[0],nil,10)
ARGF.each_line{|e|l,r=e.split.map &.to_i;puts c(o,r)-c(o,l-1)}
0