結果
問題 |
No.996 Phnom Penh
|
ユーザー |
![]() |
提出日時 | 2020-02-21 23:52:55 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
MLE
|
実行時間 | - |
コード長 | 336 bytes |
コンパイル時間 | 193 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 190,720 KB |
最終ジャッジ日時 | 2024-10-09 02:59:24 |
合計ジャッジ時間 | 3,777 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | MLE * 1 -- * 24 |
ソースコード
s = input() l = [(s, 0)] r = 0 tt = s.maketrans({'h':None, 'e':'h'}) while l: nl = [] while l: s, i = l.pop(0) if i>=0: i = s.find('phnom', i) if i>=0: nl.append((s[:i]+'penh'+s[i+5:], i+4)) i += 5 l.append((s, i)) else: if 'h' in s or 'e' in s: nl.append((s.translate(tt), 0)) l = nl r += 1 print(r-1)