結果

問題 No.436 ccw
ユーザー yawarakacreamyawarakacream
提出日時 2020-11-26 23:48:10
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,739 bytes
コンパイル時間 1,323 ms
コンパイル使用メモリ 164,248 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-10-01 03:38:17
合計ジャッジ時間 3,226 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
template<typename T, typename V> using umap = unordered_map<T, V>;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
using mapii = map<int, int>;
using umapii = umap<int, int>;
#define _rep(i, n) _repi(i, 0, n)
#define _repi(i, a, b) for(ll i = (ll) (a); i < (ll) (b); i++)
#define _get_rep(_1, _2, _3, NAME, ...) NAME
#define rep(...) _get_rep(__VA_ARGS__, _repi, _rep) (__VA_ARGS__)
#define all(x) x.begin(), x.end()
#define chmax(x, y) (x) = max((x), (y))
#define chmin(x, y) (x) = min((x), (y))
#define mkpair make_pair
#define print(...) osout(cout, __VA_ARGS__)
#define dbg(...) osout(cerr, __VA_ARGS__)
#define INF INT_MAX / 2
#define LINF LLONG_MAX / 2
template<typename T> istream& operator >>(istream& is, vector<T>& v) {
    rep(i, v.size()) { cin >> v[i]; } return is;
}
template<typename T1, typename T2> ostream& operator <<(ostream& os, pair<T1, T2> p) {
    os << p.first << ", " << p.second; return os;
}
template<typename T> ostream& operator <<(ostream& os, vector<T> v) {
    if(v.size()==0){ return os; } rep(i, v.size()-1) { os << (v[i]) << ' '; } os << v[v.size()-1]; return os;
}
void osout(ostream& os) { os << endl; }
template<class S, class... T> void osout(ostream& os, S s, T... t) {
    os << (s); if (sizeof...(t)) os << ' '; osout(os, t...);
}
void solve();

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // cout << fixed << setprecision(15);
    solve();
    return 0;
}

void solve() {
    string s;
    cin >> s;
    int c = 0;
    rep (i, s.size()) c += s[i] == 'c';
    print(min(c - 1, (int) s.size() - c));
}
0