結果
| 問題 |
No.436 ccw
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-28 22:27:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 587 bytes |
| コンパイル時間 | 1,992 ms |
| コンパイル使用メモリ | 167,340 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-24 05:44:57 |
| 合計ジャッジ時間 | 2,572 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define each(e,v) for(auto&& e:(v))
#define DEBUG(x) cout<<#x<<": "<<x<<endl
using namespace std;
using vint = vector<int>;
using vdouble = vector<double>;
using vstring = vector<string>;
int main() {
string s; cin >> s;
int cnt = 0;
each(c, s) {
if(c == 'c') cnt++;
else break;
}
int wnt = s.size() - cnt;
if(cnt <= wnt) {
cout << cnt - 1 << endl;
} else {
cout << wnt << endl;
}
return 0;
}