結果
問題 |
No.436 ccw
|
ユーザー |
![]() |
提出日時 | 2018-01-31 23:20:02 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 437 bytes |
コンパイル時間 | 626 ms |
コンパイル使用メモリ | 59,644 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 00:00:55 |
合計ジャッジ時間 | 1,609 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 WA * 1 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; string s; int main(){ cin >> s; int cnt_c = 0, cnt_w = 0; for(int i=0, n = s.size(); i<n; ++i){ if(s[i] == 'c') cnt_c++; if(s[i] == 'w') cnt_w++; } if(cnt_c < cnt_w){ cout << cnt_c-1 << endl; }else if(cnt_c >= cnt_w){ cout << cnt_w << endl; } return 0; }