結果
| 問題 |
No.345 最小チワワ問題
|
| コンテスト | |
| ユーザー |
ommadawn46
|
| 提出日時 | 2016-02-26 22:36:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 393 bytes |
| コンパイル時間 | 431 ms |
| コンパイル使用メモリ | 56,008 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 14:11:53 |
| 合計ジャッジ時間 | 1,332 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 13 |
ソースコード
#include <iostream>
using namespace std;
int main(void){
string s;
cin >> s;
int min = -1;
int ci = 0;
bool wE = false;
for(int i = 0; i < s.length(); i++){
if(s[i] == 'c'){
ci = i;
wE = false;
}else if(s[i] == 'w'){
if(wE){
if(i - ci < min || min == -1) min = i - ci + 1;
}else wE = true;
}
}
cout << min << endl;
return 0;
}
ommadawn46