結果

問題 No.380 悪の台本
ユーザー agatanagatan
提出日時 2016-06-25 14:55:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,954 bytes
コンパイル時間 5,459 ms
コンパイル使用メモリ 213,872 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 14:37:09
合計ジャッジ時間 6,451 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 4 ms
5,376 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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";
            }
        }
    }
}
0