結果

問題 No.836 じょうよ
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2019-11-08 10:34:45
言語 Ruby
(3.3.0)
結果
AC  
実行時間 191 ms / 1,000 ms
コード長 195 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 11,272 KB
実行使用メモリ 16,340 KB
最終ジャッジ日時 2023-10-13 03:10:06
合計ジャッジ時間 6,161 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 166 ms
16,288 KB
testcase_01 AC 80 ms
15,116 KB
testcase_02 AC 79 ms
15,140 KB
testcase_03 AC 83 ms
15,160 KB
testcase_04 AC 80 ms
15,160 KB
testcase_05 AC 79 ms
15,064 KB
testcase_06 AC 81 ms
15,236 KB
testcase_07 AC 80 ms
15,104 KB
testcase_08 AC 79 ms
15,252 KB
testcase_09 AC 80 ms
15,344 KB
testcase_10 AC 79 ms
15,280 KB
testcase_11 AC 88 ms
15,332 KB
testcase_12 AC 93 ms
15,368 KB
testcase_13 AC 86 ms
15,456 KB
testcase_14 AC 82 ms
15,108 KB
testcase_15 AC 89 ms
15,260 KB
testcase_16 AC 173 ms
15,904 KB
testcase_17 AC 165 ms
15,912 KB
testcase_18 AC 87 ms
15,336 KB
testcase_19 AC 97 ms
15,420 KB
testcase_20 AC 132 ms
15,592 KB
testcase_21 AC 82 ms
15,088 KB
testcase_22 AC 118 ms
15,572 KB
testcase_23 AC 167 ms
16,340 KB
testcase_24 AC 86 ms
15,236 KB
testcase_25 AC 110 ms
15,536 KB
testcase_26 AC 83 ms
15,148 KB
testcase_27 AC 83 ms
15,244 KB
testcase_28 AC 89 ms
15,504 KB
testcase_29 AC 84 ms
15,172 KB
testcase_30 AC 83 ms
15,296 KB
testcase_31 AC 89 ms
15,344 KB
testcase_32 AC 89 ms
15,412 KB
testcase_33 AC 81 ms
15,108 KB
testcase_34 AC 88 ms
15,268 KB
testcase_35 AC 89 ms
15,332 KB
testcase_36 AC 131 ms
15,668 KB
testcase_37 AC 129 ms
15,576 KB
testcase_38 AC 157 ms
16,316 KB
testcase_39 AC 137 ms
15,812 KB
testcase_40 AC 191 ms
16,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def count1Rmod(r,n,k)
  return 0 if r <= 0
  m,d = (r - 1).divmod(n)
  (k-1)%n <= d ? m + 1 : m
end
L,R,N = gets.split.map(&:to_i)
puts N.times.map{|k| count1Rmod(R,N,k) - count1Rmod(L-1,N,k) }

0