結果
| 問題 |
No.1534 おなかがいたい
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-23 18:03:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 323 bytes |
| コンパイル時間 | 1,537 ms |
| コンパイル使用メモリ | 166,656 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-05 09:28:55 |
| 合計ジャッジ時間 | 2,733 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
string s;
int n = -1;
bool f;
int main()
{
cin >> s;
for (int i = 0; i < s.size(); i++) {
if (s.substr(i, 3) == "pon") {
n++;
i += 2;
}
else if (s.substr(i, 4) == "pain") {
f = 1;
break;
}
}
if (f)
cout << n << endl;
else
cout << -1 << endl;
}