結果

問題 No.436 ccw
ユーザー parsee1053
提出日時 2020-11-08 02:35:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 82,880 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 15:00:15
合計ジャッジ時間 1,772 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  string s;
  cin >> s;
  int n = s.size();
  int c = 0, w = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'c') c++;
    if (s[i] == 'w') w++;
  }
  cout << min(c - 1, w) << endl;
  return 0;
}
0