結果

問題 No.345 最小チワワ問題
ユーザー _EnumHack
提出日時 2016-02-28 01:34:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 4,200 ms
コンパイル使用メモリ 209,132 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 11:57:19
合計ジャッジ時間 5,148 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <regex>
#include <string>
#include <iostream>

int main(){
	std::string str;
	std::cin >> str;

	std::smatch m;
    size_t result;
	if( std::regex_search(str, m, std::regex{"c.*w.*w"}) ){
		while(std::regex_search(str, m, std::regex{"c.*w.*w"})){
            result = m.str().length();
            str = m.str();
            str.pop_back();
        }
        std::cout << result << std::endl;
	}
	else{
		std::cout << -1 << std::endl;
	}
	return 0;
}
0