結果

問題 No.784 「,(カンマ)」
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2019-10-31 17:45:10
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 144 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 11,468 KB
実行使用メモリ 15,276 KB
最終ジャッジ日時 2023-10-13 00:07:16
合計ジャッジ時間 2,557 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,044 KB
testcase_01 AC 81 ms
15,104 KB
testcase_02 AC 82 ms
15,228 KB
testcase_03 AC 80 ms
15,168 KB
testcase_04 AC 81 ms
15,224 KB
testcase_05 AC 80 ms
15,092 KB
testcase_06 AC 80 ms
15,232 KB
testcase_07 AC 82 ms
15,048 KB
testcase_08 AC 82 ms
15,156 KB
testcase_09 AC 82 ms
15,248 KB
testcase_10 WA -
testcase_11 AC 82 ms
15,128 KB
testcase_12 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def format_comma(n)
  s = ''
  until n < 1000
    n,m = n.divmod(1000)
    s = ",#{m}#{s}"
  end
  "#{n}#{s}"
end
puts format_comma(gets.to_i)

0