結果

問題 No.418 ミンミンゼミ
ユーザー naniwha12
提出日時 2019-01-28 23:40:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 715 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 55,032 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 17:03:54
合計ジャッジ時間 1,284 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <stdlib.h>

using namespace std;

int
main() {
        // mi(-)*n
        int j = 2;
        int i = 0;
        string s;
        cin >> s;
        cerr << "s[2] = " << s[2] << endl;
        while (1) { 
                for (; s[j] == '-'; j++);
                // n
                j++;
                // \n | m
                cerr << "s[" << j << "] = " << s[j] << endl;
                i++;
                if (s[j] != 'm') {
                        cout << i << endl;
                        return 0;
                }
                // m
                j++;
                // i
                j++;
                // -
        }
        return 0;
}       
0