結果
問題 |
No.436 ccw
|
ユーザー |
![]() |
提出日時 | 2016-10-30 15:09:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 487 bytes |
コンパイル時間 | 1,391 ms |
コンパイル使用メモリ | 160,084 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 23:35:38 |
合計ジャッジ時間 | 2,213 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> //const static double de_PI = 3.14159265358979323846; //const static int de_MOD = 1000000007; //const static int de_MAX = 999999999; //const static int de_MIN = -999999999; int main(void) { //std::ifstream in("123.txt"); std::cin.rdbuf(in.rdbuf()); std::string S; std::cin >> S; int c = std::count(S.begin(), S.end(), 'c'); int w = S.length() - c; if (c - 1 > w) { std::cout << w << std::endl; } else { std::cout << c - 1 << std::endl; } }