結果
| 問題 |
No.509 塗りつぶしツール
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-28 23:33:53 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 93 ms / 2,000 ms |
| コード長 | 196 bytes |
| コンパイル時間 | 211 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-09-13 18:38:21 |
| 合計ジャッジ時間 | 3,691 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.chomp
tot = 2
tot2 = 1
qq = [3,1,1,1,3,1,3,1,5,3]
qq2 = [3,2,2,2,3,2,3,2,4,3]
for c in n.split('')
tot += qq[c.ord - 48]
tot2 += qq2[c.ord - 48]
end
tot2 = [tot2, tot].min
puts tot2