結果
問題 | No.436 ccw |
ユーザー |
![]() |
提出日時 | 2016-10-28 22:22:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 780 bytes |
コンパイル時間 | 1,341 ms |
コンパイル使用メモリ | 120,256 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 05:37:49 |
合計ジャッジ時間 | 2,030 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include<iostream> #include<vector> #include<string> #include<array> #include<algorithm> #include<list> #include<cmath> #include<iomanip> #include<queue> #include<functional> #include<climits> #include<iterator> #include<unordered_set> #include<unordered_map> #include<map> #include<set> #include<typeinfo> #include<numeric> #include<complex> #include<memory> #include<fstream> #include<chrono> #include<random> using namespace std; const double pi=4*atan(1.0); constexpr long long mod=static_cast<long long>(1e9+7); using cWeightEdges=vector<vector<pair<int,int>>>; using cEdges=vector<vector<int>>; int main(){ string str; cin>>str; int c=0,w=0; for(const auto& val:str){ if(val=='c')++c; else ++w; } --c; cout<<min(c,w)<<endl; //system("pause"); return 0; }