結果

問題 No.1534 おなかがいたい
ユーザー yuruhiya
提出日時 2021-07-16 14:06:20
言語 Crystal
(1.14.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 118 bytes
コンパイル時間 12,141 ms
コンパイル使用メモリ 295,652 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 21:31:09
合計ジャッジ時間 13,250 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

s = read_line
if i = s.index("pain")
	cnt = s[0...i].scan("pon").size
	puts cnt < 2 ? -1 : cnt - 1
else
  puts -1
end
0