結果
問題 | No.436 ccw |
ユーザー |
|
提出日時 | 2016-10-28 22:30:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 270 bytes |
コンパイル時間 | 646 ms |
コンパイル使用メモリ | 66,676 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 05:46:58 |
合計ジャッジ時間 | 1,214 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include<iostream>#include<string>#include<algorithm>using namespace std;int main(){int a=0,c=0;string s;cin>>s;for(int i=0;i<s.length();i++)if(s[i]=='c')a++;a--;for(int i=s.length()-1;i>=0;i--)if(s[i]=='w')c++;cout<<min(a,c)<<endl;return 0;}