結果

問題 No.380 悪の台本
ユーザー te-shte-sh
提出日時 2017-07-24 15:38:42
言語 D
(dmd 2.105.2)
結果
AC  
実行時間 71 ms / 1,000 ms
コード長 672 bytes
コンパイル時間 9,342 ms
コンパイル使用メモリ 643,968 KB
実行使用メモリ 4,748 KB
最終ジャッジ日時 2023-09-03 15:26:34
合計ジャッジ時間 10,527 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 12 ms
4,384 KB
testcase_05 AC 25 ms
4,384 KB
testcase_06 AC 14 ms
4,384 KB
testcase_07 AC 71 ms
4,748 KB
testcase_08 AC 10 ms
4,380 KB
testcase_09 AC 10 ms
4,384 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