結果

問題 No.1534 おなかがいたい
ユーザー googol_S0
提出日時 2021-06-06 18:01:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 60,620 KB
最終ジャッジ日時 2024-11-23 01:43:58
合計ジャッジ時間 2,431 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

S=input()
C=0
for i in range(len(S)):
  if S[i:i+3]=='pon':
    C+=1
  elif S[i:i+4]=='pain':
    if C<2:
      print(-1)
    else:
      print(C-1)
    exit()
print(-1)
0