結果
問題 | No.436 ccw |
ユーザー |
![]() |
提出日時 | 2016-10-28 22:26:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 384 bytes |
コンパイル時間 | 490 ms |
コンパイル使用メモリ | 57,180 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 05:44:19 |
合計ジャッジ時間 | 1,312 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include <iostream>using namespace std;int count5126(string str, string a) {int i = 0, cnt = 0;if (a == "") { return -1; }while ((i = str.find(a, i)) > -1) { ++cnt; i += a.size(); }return cnt;}int main() {string s;int c, w;cin >> s;c = count5126(s, "c") - 1;w = count5126(s, "w");cout << (c < w ? c : w) << endl;return 0;}