結果
| 問題 |
No.1534 おなかがいたい
|
| コンテスト | |
| ユーザー |
nohakai3
|
| 提出日時 | 2022-07-01 16:55:26 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 327 bytes |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 12,516 KB |
| 最終ジャッジ日時 | 2024-11-25 21:30:16 |
| 合計ジャッジ時間 | 1,770 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 12 WA * 7 |
ソースコード
s=list(input())
n=len(s)
l=[]
y=10**6
for i in range(n-3):
if s[i]=="p" and s[i+1]=="a" and s[i+2]=="i" and s[i+3]=="n":
y=i
break
if y==10**6:
exit(print(-1))
ans=0
for i in range(y-3):
if s[i]=="p" and s[i+1]=="o" and s[i+2]=="n":
ans+=1
if ans<=1:
print(-1)
else:
print(ans)
nohakai3