結果
問題 | No.418 ミンミンゼミ |
ユーザー |
![]() |
提出日時 | 2018-12-29 00:24:27 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 489 bytes |
コンパイル時間 | 567 ms |
コンパイル使用メモリ | 57,724 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-01 15:04:03 |
合計ジャッジ時間 | 1,048 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
#include <iostream>#include <algorithm>#include <cstdio>#include <string>#define ll long longusing namespace std;int main(){string s;cin>>s;int cnt=0;int state=0;for(int i=0;i<s.length();++i){if(state==0&&s[i]=='m') state=1;else if(state==1&&s[i]=='i') state=2;else if(state==2&&s[i]=='n'){state=0;cnt++;}else if(state==2&&s[i]=='-') state=2;else state=0;}cout<<cnt<<endl;return 0;}