結果
問題 |
No.1534 おなかがいたい
|
ユーザー |
![]() |
提出日時 | 2022-07-01 16:51:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 329 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 12,512 KB |
最終ジャッジ日時 | 2024-11-25 21:25:34 |
合計ジャッジ時間 | 2,080 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 3 |
other | AC * 15 WA * 4 |
ソースコード
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)