結果
| 問題 | No.996 Phnom Penh |
| コンテスト | |
| ユーザー |
wonda_t_coffee
|
| 提出日時 | 2020-02-21 22:51:23 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 331 bytes |
| 記録 | |
| コンパイル時間 | 69 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 84,848 KB |
| 最終ジャッジ日時 | 2026-04-25 03:30:07 |
| 合計ジャッジ時間 | 4,593 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
s = ''
len = (1..(100)).to_a.sample
len.times do
s << [?p, ?h, ?n, ?o, ?m, ?e].sample
end
puts s
puts len
s = gets.chomp
ans = 0
while true
f = false
t = s.gsub("phnom", "penh")
f |= s != t
ans += s.size - t.size
u = t.gsub("h", "").gsub("e", "h")
f |= t != u
break unless f
ans += 1
s = u
end
puts ans
wonda_t_coffee