結果
問題 | No.436 ccw |
ユーザー |
![]() |
提出日時 | 2016-10-28 22:23:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 482 bytes |
コンパイル時間 | 1,119 ms |
コンパイル使用メモリ | 159,748 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 05:37:51 |
合計ジャッジ時間 | 1,825 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define FOR(i,l,r) for(int i = (l);i < (r);i++)#define ALL(x) (x).begin(),(x).end()template<typename T> bool chmax(T& a,const T& b){return a < b ? (a = b,true) : false;}template<typename T> bool chmin(T& a,const T& b){return b < a ? (a = b,true) : false;}typedef long long ll;int N;string S;int main(){cin >> S;N = S.size();int c = count(ALL(S),'c'),w = count(ALL(S),'w');cout << min(c - 1,w) << endl;return 0;}