結果
問題 | No.345 最小チワワ問題 |
ユーザー |
![]() |
提出日時 | 2016-03-29 20:25:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 392 bytes |
コンパイル時間 | 4,099 ms |
コンパイル使用メモリ | 209,640 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-02 07:28:24 |
合計ジャッジ時間 | 5,123 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 19 |
ソースコード
#include<iostream> #include<string> #include<regex> using namespace std; int main() { string s; regex regex("c.*w.*w"); smatch match; int min = 100; cin >> s; if (regex_search(s, match, regex) == false) { cout << -1 << endl; return 0; } for (size_t i = 0; i < match.size(); ++i) { if (match.length(i) < min) { min = match.length(i); } } cout << min << endl; return 0; }