結果

問題 No.418 ミンミンゼミ
ユーザー alchemin
提出日時 2019-09-17 10:35:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 472 bytes
コンパイル時間 1,743 ms
コンパイル使用メモリ 168,512 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-07 06:50:38
合計ジャッジ時間 2,336 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    string s;
    string min_str = "";
    
    cin >> s;
    
    for (int i = 0; i < s.length(); i++) {
        if (s[i] != '-') {
            min_str += s[i];
        }
    }
    
    int ct = 0;
    for (int i = 0; i < min_str.length() - 2; i++) {
        if (min_str[i] == 'm' && min_str[i + 1] == 'i' && min_str[i + 2]) {
            ct++;
        }
    }
    
    cout << ct << endl;
    
    return 0;
}
0