結果
問題 | No.436 ccw |
ユーザー |
![]() |
提出日時 | 2016-10-28 22:30:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 944 bytes |
コンパイル時間 | 632 ms |
コンパイル使用メモリ | 85,140 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 05:47:20 |
合計ジャッジ時間 | 1,420 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#define _USE_MATH_DEFINES#include <sstream> //string stream its useful!#include<string>#include<iostream>#include<utility> //pair#include <vector> // vector#include <algorithm> // swap,sort,binary_search#include <functional> // std::greater#include <map> //map#include<set> //set#include<queue> //queue#include<list> //list#include<cmath>#include<numeric>#include<cassert>#include <iomanip> //cout<<setprecisiontypedef long long ll;#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))using namespace std;void omajinai() {cin.tie(0);ios::sync_with_stdio(false);cout<<setprecision(15);//freopen("txt.csv","r",stdin);}int main(){omajinai();string s;cin>>s;int cl = 0,wl = 0;for(char c:s){if (c =='c') cl++; else break;}reverse(s.begin(),s.end());for (char c: s){if(c == 'w') wl++; else break;}cout<<min(cl-1,wl);}