結果

問題 No.1534 おなかがいたい
ユーザー pluto77pluto77
提出日時 2021-06-25 10:21:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 167 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 8,440 KB
最終ジャッジ日時 2023-09-07 13:32:49
合計ジャッジ時間 2,757 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,856 KB
testcase_01 AC 14 ms
7,804 KB
testcase_02 AC 15 ms
7,804 KB
testcase_03 AC 16 ms
7,852 KB
testcase_04 AC 15 ms
7,800 KB
testcase_05 AC 14 ms
7,772 KB
testcase_06 AC 13 ms
7,840 KB
testcase_07 AC 14 ms
7,824 KB
testcase_08 AC 13 ms
7,804 KB
testcase_09 AC 14 ms
7,812 KB
testcase_10 AC 14 ms
7,728 KB
testcase_11 AC 14 ms
7,888 KB
testcase_12 AC 91 ms
8,312 KB
testcase_13 AC 104 ms
8,432 KB
testcase_14 AC 107 ms
8,408 KB
testcase_15 AC 14 ms
8,440 KB
testcase_16 AC 103 ms
8,288 KB
testcase_17 AC 105 ms
8,300 KB
testcase_18 AC 99 ms
8,372 KB
testcase_19 AC 15 ms
8,432 KB
testcase_20 AC 105 ms
8,256 KB
testcase_21 AC 15 ms
7,760 KB
testcase_22 AC 13 ms
7,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1534
s=input()
pon=0
for i in range(len(s)):
 if s[i:i+3]=='pon':
  pon+=1
 if s[i:i+4]=='pain':
  break
if pon<=1 or i==len(s)-1:
 print(-1)
else:
 print(pon-1)
0