結果
| 問題 |
No.1534 おなかがいたい
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-08 13:16:31 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 2,000 ms |
| コード長 | 255 bytes |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 11,084 KB |
| 最終ジャッジ日時 | 2024-12-26 17:19:41 |
| 合計ジャッジ時間 | 2,149 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)