結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2017-05-19 22:06:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 176 ms / 1,000 ms |
コード長 | 875 bytes |
コンパイル時間 | 6,737 ms |
コンパイル使用メモリ | 250,812 KB |
最終ジャッジ日時 | 2025-01-05 00:25:36 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 |
ソースコード
#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; }