結果
問題 | No.418 ミンミンゼミ |
ユーザー |
![]() |
提出日時 | 2016-09-19 06:21:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 422 bytes |
コンパイル時間 | 1,765 ms |
コンパイル使用メモリ | 167,016 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-16 01:24:34 |
合計ジャッジ時間 | 2,167 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define REP(i,n) for(int i = 0; i < (int)(n); ++i)typedef long long ll;int main() {string S;cin >> S;int ans = 0, tmp = 0;REP(i,S.length()){if(S[i]=='m' && S[i+1]=='i' && tmp==0){ans++;tmp++;}if(S[i]=='n' && tmp==1){ans++;tmp--;}}cout << ans/2 << endl;}