結果

問題 No.996 Phnom Penh
ユーザー tsunatama5
提出日時 2020-02-21 22:47:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 331 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,212 KB
最終ジャッジ日時 2024-10-08 22:26:00
合計ジャッジ時間 4,026 ms
ジャッジサーバーID
(参考情報)
judge5 / 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
    fd = s.find('h')
    if fd > -1:
        s = s.replace('h', '')
        s = s.replace('e', 'h')
        n += 1
    if s == fi:
        n = num
        break
print(n)
0