結果

問題 No.996 Phnom Penh
ユーザー tsunatama5
提出日時 2020-02-21 22:55:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-10-08 22:34:12
合計ジャッジ時間 3,635 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
n = 0
num = -1
while num < n:
    num = n
    fi = s
    fd = s.find('phnom')
    if fd > -1:
        s = s.replace('phnom', 'penh', 1)
        n += 1
        if s == fi:
            n -= 1
            s = fi
    fi = s
    fd = s.find('h')
    if fd > -1:
        s = s.replace('h', '')
        s = s.replace('e', 'h')
        n += 1
        if s == fi:
            n -= 1
            s = fi
print(n)
0