結果

問題 No.345 最小チワワ問題
ユーザー free57575757
提出日時 2016-02-28 11:52:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 529 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 56,944 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 12:00:52
合計ジャッジ時間 1,375 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

#define LIMIT 100

int main()
{
    char s[LIMIT+1];
    int result = -1;
    
    cin >> s;
    
    for (int i = 0; i < LIMIT+1; i++) {
        if (s[i] == 'c') {
            for (int j = i+1; j < LIMIT+1; j++) {
                if (s[j] == 'w') {
                    for (int k = j+1; k < LIMIT+1; k++) {
                        if (s[k] == 'w') result = k - i + 1;
                     }
                }
            }
        }
    }
    cout << result << endl;
    
    return 0;
}
0