結果
問題 | No.418 ミンミンゼミ |
ユーザー |
|
提出日時 | 2017-08-27 22:14:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 410 bytes |
コンパイル時間 | 510 ms |
コンパイル使用メモリ | 64,440 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-16 02:26:14 |
合計ジャッジ時間 | 1,253 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
#include <iostream>#include <string>using namespace std;int main(){string s;cin >> s;int state = 0;int num = 0;for(int i = 0; i < s.size(); i++){if(state == 0){if(s[i] == 'm'){state = 1;}} else if (state == 1){if(s[i] == 'i'){state =2;} else {state = 0;}} else {if(s[i] == '-'){state = 2;} else if (s[i] == 'n'){num++;state= 0;} else {state = 0;}}}cout << num << endl;return 0;}