結果
| 問題 | No.1534 おなかがいたい |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-13 17:30:35 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 355 bytes |
| 記録 | |
| コンパイル時間 | 82 ms |
| コンパイル使用メモリ | 80,512 KB |
| 実行使用メモリ | 59,648 KB |
| 最終ジャッジ日時 | 2026-09-09 07:41:22 |
| 合計ジャッジ時間 | 6,946 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 5 TLE * 1 -- * 13 |
ソースコード
def main():
s=input()
if s.find("pain")==-1:
print(-1)
exit()
cnt=0
while True:
if s[0:3]=="pon":
s=s[3:]
cnt+=1
else:
s=s[1:]
if s[0:4]=="pain":
break
result = -1 if cnt<2 else cnt-1
print(result)
if __name__ == "__main__":
main()