結果
| 問題 |
No.436 ccw
|
| ユーザー |
tenkyu9
|
| 提出日時 | 2018-03-18 07:19:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 477 bytes |
| コンパイル時間 | 992 ms |
| コンパイル使用メモリ | 80,668 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-25 21:07:12 |
| 合計ジャッジ時間 | 2,224 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 WA * 1 |
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<climits>
using namespace std;
typedef long long int ll;
int main(){
int c=0, w=0;
bool flag=true;
string s;
cin >> s;
for(int i=0; i<s.size(); i++){
if(s[i]=='w') flag=false;
if(flag){
c++;
} else {
w++;
}
}
if(c<w){
cout << c-1 << endl;
} else {
cout << w << endl;
}
return 0;
}
tenkyu9