結果
問題 | No.436 ccw |
ユーザー |
|
提出日時 | 2016-11-03 00:54:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 437 ms |
コンパイル使用メモリ | 55,716 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 01:48:07 |
合計ジャッジ時間 | 1,258 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include<iostream> #include<string> using namespace std; int main(){ string S; cin >> S; int i, Clen, Wlen; //cout << S << endl; //cout << S[2] << endl; //cout << S.size() << endl; for(i = 0; i < S.size()-1; i++){ if(S[i] == S[i+1]){ continue; } else{ break; } } Clen = i+1; Wlen = S.size() - Clen; if(Clen - 1 >= Wlen){ cout << Wlen << endl; } else{ cout << Clen - 1 << endl; } return 0; }