結果
| 問題 | No.996 Phnom Penh |
| コンテスト | |
| ユーザー |
wonda_t_coffee
|
| 提出日時 | 2020-02-21 22:51:58 |
| 言語 | Ruby (4.0.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 345 bytes |
| 記録 | |
| コンパイル時間 | 216 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 81,744 KB |
| 最終ジャッジ日時 | 2024-10-08 22:31:53 |
| 合計ジャッジ時間 | 6,396 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 TLE * 1 |
コンパイルメッセージ
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