結果
問題 | No.436 ccw |
ユーザー |
![]() |
提出日時 | 2016-10-28 22:22:15 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 698 bytes |
コンパイル時間 | 717 ms |
コンパイル使用メモリ | 83,304 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 05:34:45 |
合計ジャッジ時間 | 1,770 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <sstream> #include <functional> #include <map> #include <string> #include <cstring> #include <vector> #include <queue> #include <stack> #include <deque> #include <set> #include <list> #include <numeric> using namespace std; const double PI = 3.14159265358979323846; const double EPS = 1e-12; const int INF = 1<<25; typedef pair<int,int> P; typedef long long ll; typedef unsigned long long ull; int main(){ int a = 0, b = 0; string s; cin>>s; for(int i = 0; i < s.size(); i++){ if(s[i]=='c') a++; else b++; } cout<<min(a-1, b)<<endl; return 0; }