結果

問題 No.380 悪の台本
ユーザー te-shte-sh
提出日時 2017-07-24 15:36:56
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 671 bytes
コンパイル時間 10,216 ms
コンパイル使用メモリ 645,012 KB
実行使用メモリ 4,812 KB
最終ジャッジ日時 2023-09-03 15:26:10
合計ジャッジ時間 10,989 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;
import std.regex;     // RegEx

void main()
{
  auto re = ["digi":  regex("nyo[^0-9A-Za-z]{0,3}$", "i"),
             "petit": regex("nyu[^0-9A-Za-z]{0,3}$", "i"),
             "rabi":  regex("[0-9A-Za-z]"),
             "gema":  regex("gema[^0-9A-Za-z]{0,3}$", "i"),
             "piyo":  regex("pyo[^0-9A-Za-z]{0,3}$", "i")];

  string line;
  while ((line = readln) !is null) {
    auto m = line.chomp.matchFirst(r"([a-z]+) (.*)");
    auto actor = m[1], words = m[2];
    if (actor !in re || words.matchFirst(re[actor]).empty)
      writeln("WRONG!");
    else
      writeln("CORRECT (maybe)");
  }
}
0