結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2016-06-25 14:55:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,954 bytes |
コンパイル時間 | 5,101 ms |
コンパイル使用メモリ | 218,320 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-06 23:01:43 |
合計ジャッジ時間 | 6,039 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 2 WA * 6 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <utility> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <regex> using namespace std; int main() { string line; while (getline(cin, line)) { int spidx = line.find(' '); string name = line.substr(0, spidx); string msg = line.substr(spidx + 1); if (name == "digi") { if (!regex_match(msg, regex(".*nyo([^0-9a-zA-Z]{0,3})$", regex_constants::ECMAScript | regex_constants::icase))) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else if (name == "petit") { if (!regex_match(msg, regex(".*nyu[^0-9a-zA-Z]{0,3}$", regex_constants::ECMAScript | regex_constants::icase))) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else if (name == "rabi") { auto it = find_if(msg.begin(), msg.end(), [](auto &&c) { return !isalnum(c); }); if (it == msg.end()) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else if (name == "gema") { if (!regex_match(msg, regex(".*gema([^0-9a-zA-Z]{0,3})$", regex_constants::ECMAScript | regex_constants::icase))) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else if (name == "piyo") { if (!regex_match(msg, regex(".*pyo[^0-9a-zA-Z]{0,3}$", regex_constants::ECMAScript | regex_constants::icase))) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } } }