結果

問題 No.436 ccw
ユーザー kpinkcat
提出日時 2023-08-14 09:50:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 944 ms
コンパイル使用メモリ 104,004 KB
最終ジャッジ日時 2025-02-16 08:03:43
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<set>
#include<bitset>
#include<math.h>
#include<map>
#include<queue>
#include<iomanip>
using namespace std;
#ifdef _WIN32
#include <Windows.h>
#endif

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