結果
| 問題 |
No.1534 おなかがいたい
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-08 13:17:24 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 36 ms / 2,000 ms |
| コード長 | 255 bytes |
| コンパイル時間 | 457 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-12-26 17:20:58 |
| 合計ジャッジ時間 | 1,737 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
import re
import sys
S = input()
if "pain" not in S:
print(-1)
sys.exit()
S = S.split("pain")
# print(S)
results = re.findall(r"pon", S[0])
if len(results) >= 2:
print(len(results)-1)
elif len(results) == 1:
print(-1)
else:
print(-1)