結果
| 問題 |
No.418 ミンミンゼミ
|
| コンテスト | |
| ユーザー |
nizi26i26
|
| 提出日時 | 2016-09-09 22:28:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 489 bytes |
| コンパイル時間 | 443 ms |
| コンパイル使用メモリ | 57,776 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-16 01:15:00 |
| 合計ジャッジ時間 | 1,176 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
const int INF=10000000;
int main(){
string s;
int ans=0;
cin>>s;
bool ok=false;
for(int i=0;i<s.size();i++){
if(i+1<s.size()&&s[i]=='m'&&s[i+1]=='i'){
ok=true;
i++;
continue;
}
if(ok&&s[i]=='n'){
ok=false;
if(i+1>=s.size()||s[i+1]!='n')
ans++;
continue;
}
if(ok&&s[i]!='-'){
ok=false;
continue;
}
}
cout<<ans<<endl;
return 0;
}
nizi26i26