結果

問題 No.345 最小チワワ問題
ユーザー mell1
提出日時 2018-11-24 00:43:43
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 687 ms
コンパイル使用メモリ 53,320 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-24 18:59:32
合計ジャッジ時間 1,640 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
    int c=0,w=0;
    char a;
    bool cww=false;
    while (!cww) {
        a = getchar();
        if (a < 97 || 122 < a) break;
        if (c) {
            if (w) {
                if (a == 'w') {
                    cww = true;
                }
            } else if (a == 'w') {
                w++;
            }
            c++;
        } else if (a == 'c') {
            c++;
        }
    }
    if (cww) cout << c << endl;
    else cout << -1 << endl;
    return 0;
}
0