結果
| 問題 |
No.418 ミンミンゼミ
|
| コンテスト | |
| ユーザー |
language_43
|
| 提出日時 | 2016-09-12 15:12:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 598 bytes |
| コンパイル時間 | 606 ms |
| コンパイル使用メモリ | 66,572 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-16 01:22:53 |
| 合計ジャッジ時間 | 1,608 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
# include <iostream>
# include <cstring>
# include <string>
# include <vector>
# include <cmath>
# include <sstream>
# include <algorithm>
using namespace std;
int main(){
int sum = 0;
string str;
cin >> str;
int i=0;
int count =0;
while(i <= str.size()){
if(str[i] == 'm' && str[i+1] == 'i'){
i+=2;
count = 1;
}else if(str[i] == '-' && count == 1){
i++;
count = 2;
}else if(str[i] == 'n' && str[i+1] != 'n' && (count == 1 || count == 2)){
i+=2;
sum++;
}else if(str[i] == 'n' && str[i+1] != 'n'){
i+=2;
}else{
i++;
}
}
cout << sum << endl;
return 0;
}
language_43