結果
| 問題 | No.1534 おなかがいたい |
| コンテスト | |
| ユーザー |
kkkk97368086
|
| 提出日時 | 2021-12-07 13:56:07 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| + 227µs | |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 1,173 ms |
| コンパイル使用メモリ | 202,352 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-11 07:47:26 |
| 合計ジャッジ時間 | 2,887 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
int main() {
string S; cin >> S;
int s = S.find("pain");
if(s != -1){
string T = S.substr(0, s);
int ans = 0;
for(int i = 0; i < (int)T.size()-2; i++){
string U = "";
U += T[i]; U += T[i+1]; U += T[i+2];
if(U == "pon") ans++;
}
if(ans < 2) ans = 0;
cout << ans-1 << endl;
}else{
cout << s << endl;
}
}
kkkk97368086