結果
問題 |
No.996 Phnom Penh
|
ユーザー |
|
提出日時 | 2020-02-21 23:49:09 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 472 bytes |
コンパイル時間 | 218 ms |
コンパイル使用メモリ | 7,680 KB |
実行使用メモリ | 17,920 KB |
最終ジャッジ日時 | 2024-10-09 02:52:06 |
合計ジャッジ時間 | 4,369 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 WA * 2 |
コンパイルメッセージ
Syntax OK
ソースコード
$s = STDIN.gets $ans = 0 def f temp = 0 $s.scan(/phnom/).each do |t| temp += 1 end if $s.include?("phnom") then $s.gsub!(/phnom/, "penh") end if $s.include?("h") then temp += 1 $s.gsub!(/h/, "") $s.gsub!(/e/, "h") end # puts $s temp end $ans += f $ans += f $s.scan(/phn(?:om)+/).each do |t| $ans += t.length - 3 end if $s.include?("phnom") then $ans += 1 elsif $s.include?("h") then $ans += 1 end puts $ans