結果

問題 No.380 悪の台本
ユーザー tabataba
提出日時 2017-05-19 22:06:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 158 ms / 1,000 ms
コード長 875 bytes
コンパイル時間 5,930 ms
コンパイル使用メモリ 252,552 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 14:56:26
合計ジャッジ時間 6,753 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <random>
#include <vector>
#include <algorithm>
#include <array>
#include <functional>
#include <utility>
#include <regex>
#include <tuple>
#include <map>
#include <set>
#include <iostream>

using namespace std;

int main(){
	map<char,regex> re;
	re['g']=regex(R"([Nn][Yy][Oo][^A-Za-z0-9]{0,3}$)");
	re['t']=regex(R"([Nn][Yy][Uu][^A-Za-z0-9]{0,3}$)");
	re['b']=regex(R"([A-Za-z0-9])");
	re['m']=regex(R"([Gg][Ee][Mm][Aa][^A-Za-z0-9]{0,3}$)");
	re['y']=regex(R"([Pp][Yy][Oo][^A-Za-z0-9]{0,3}$)");
	regex namere(R"(^(digi|petit|rabi|gema|piyo)[ 	])");
	string s;
	while(getline(cin,s)){
		if(regex_search(s,namere)){
			char n=s[2];
			s=regex_replace(s,namere,"");
			//puts(s.c_str());
			puts(regex_search(s,re[n])?"CORRECT (maybe)":"WRONG!");	
		}else{
			puts("WRONG!");
		}
	}
	return 0;
}
0