結果

問題 No.1534 おなかがいたい
ユーザー nohakai3nohakai3
提出日時 2022-07-01 16:51:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 9,688 KB
最終ジャッジ日時 2023-08-17 03:47:59
合計ジャッジ時間 2,082 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 16 ms
7,960 KB
testcase_03 WA -
testcase_04 AC 15 ms
7,824 KB
testcase_05 WA -
testcase_06 AC 16 ms
7,988 KB
testcase_07 WA -
testcase_08 AC 15 ms
7,784 KB
testcase_09 AC 16 ms
7,888 KB
testcase_10 AC 16 ms
7,988 KB
testcase_11 WA -
testcase_12 AC 58 ms
9,688 KB
testcase_13 AC 40 ms
9,584 KB
testcase_14 AC 47 ms
9,584 KB
testcase_15 AC 20 ms
9,616 KB
testcase_16 AC 77 ms
9,656 KB
testcase_17 AC 76 ms
9,656 KB
testcase_18 AC 76 ms
9,652 KB
testcase_19 AC 19 ms
9,616 KB
testcase_20 AC 102 ms
9,620 KB
testcase_21 WA -
testcase_22 AC 15 ms
7,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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-1)
0