結果
| 問題 |
No.436 ccw
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-30 20:02:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 2,000 ms |
| コード長 | 266 bytes |
| コンパイル時間 | 1,901 ms |
| コンパイル使用メモリ | 193,308 KB |
| 最終ジャッジ日時 | 2025-01-07 10:08:36 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string s;
cin>>s;
int c=0;
int w=0;
for (char ch : s) {
if (ch == 'c') c++;
else w++;
}
cout << max(0, min(c-1, w)) << endl;
return 0;
}