結果

問題 No.836 じょうよ
ユーザー gemmarogemmaro
提出日時 2020-03-09 10:55:55
言語 Ruby
(3.3.0)
結果
AC  
実行時間 222 ms / 1,000 ms
コード長 367 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 11,240 KB
実行使用メモリ 33,792 KB
最終ジャッジ日時 2023-08-07 16:36:12
合計ジャッジ時間 7,561 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 186 ms
24,988 KB
testcase_01 AC 77 ms
15,244 KB
testcase_02 AC 77 ms
15,248 KB
testcase_03 AC 76 ms
15,048 KB
testcase_04 AC 77 ms
15,252 KB
testcase_05 AC 77 ms
15,088 KB
testcase_06 AC 78 ms
15,144 KB
testcase_07 AC 77 ms
15,284 KB
testcase_08 AC 77 ms
14,988 KB
testcase_09 AC 76 ms
15,036 KB
testcase_10 AC 78 ms
15,052 KB
testcase_11 AC 87 ms
16,112 KB
testcase_12 AC 92 ms
15,904 KB
testcase_13 AC 86 ms
15,876 KB
testcase_14 AC 81 ms
15,340 KB
testcase_15 AC 88 ms
16,152 KB
testcase_16 AC 193 ms
24,832 KB
testcase_17 AC 178 ms
25,932 KB
testcase_18 AC 85 ms
15,584 KB
testcase_19 AC 96 ms
16,828 KB
testcase_20 AC 139 ms
21,236 KB
testcase_21 AC 82 ms
15,344 KB
testcase_22 AC 128 ms
21,000 KB
testcase_23 AC 186 ms
25,056 KB
testcase_24 AC 84 ms
15,608 KB
testcase_25 AC 116 ms
20,880 KB
testcase_26 AC 79 ms
15,160 KB
testcase_27 AC 80 ms
15,544 KB
testcase_28 AC 87 ms
15,876 KB
testcase_29 AC 81 ms
15,536 KB
testcase_30 AC 80 ms
15,388 KB
testcase_31 AC 88 ms
16,120 KB
testcase_32 AC 88 ms
16,184 KB
testcase_33 AC 80 ms
15,320 KB
testcase_34 AC 86 ms
16,088 KB
testcase_35 AC 87 ms
16,192 KB
testcase_36 AC 138 ms
21,420 KB
testcase_37 AC 135 ms
21,392 KB
testcase_38 AC 167 ms
25,700 KB
testcase_39 AC 148 ms
26,036 KB
testcase_40 AC 222 ms
33,792 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

def f(x)
  Array.new(N, Rational(x, N).floor).zip(
    [1] * (x - N * Rational(x, N).floor) +
    [0] * (N * (1 + Rational(x, N).floor) - x)
  ).map { |a, b| a + b }
end

# -------------------------------------------- exec

L, R, N = gets.chomp.split.map(&:to_i)

RESULT = f(R).zip(f(L - 1)).map { |a, b| a - b }.rotate(-1)

puts RESULT
0