結果

問題 No.380 悪の台本
ユーザー ぴろずぴろず
提出日時 2017-01-25 01:39:39
言語 Java21
(openjdk 21)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 940 bytes
コンパイル時間 2,138 ms
コンパイル使用メモリ 74,316 KB
実行使用メモリ 55,524 KB
最終ジャッジ日時 2024-04-24 14:54:41
合計ジャッジ時間 5,998 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,144 KB
testcase_01 AC 123 ms
40,424 KB
testcase_02 AC 129 ms
41,332 KB
testcase_03 AC 128 ms
41,500 KB
testcase_04 AC 286 ms
45,332 KB
testcase_05 AC 383 ms
49,220 KB
testcase_06 AC 391 ms
46,812 KB
testcase_07 TLE -
testcase_08 AC 211 ms
42,944 KB
testcase_09 AC 302 ms
46,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no380;

import java.io.PrintStream;
import java.util.Scanner;
import java.util.regex.Pattern;

public class Main {
	//無理
	public static Pattern[] patterns = {
			Pattern.compile("digi +.*[nN][yY][oO][^a-zA-Z0-9]{0,3}"),
			Pattern.compile("petit +.*[nN][yY][uU][^a-zA-Z0-9]{0,3}"),
			Pattern.compile("rabi +.*[a-zA-Z0-9]+.*"),
			Pattern.compile("gema +.*[gG][eE][mM][aA][^a-zA-Z0-9]{0,3}"),
			Pattern.compile("piyo +.*[pP][yY][oO][^a-zA-Z0-9]{0,3}"),};
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.setOut(new PrintStream(System.out, false));
		while(sc.hasNextLine()) {
			String s = sc.nextLine();
			boolean correct = false;
			for(Pattern pat: patterns) {
				if (pat.matcher(s).matches()) {
					correct = true;
					break;
				}
			}
			if (correct) {
				System.out.println("CORRECT (maybe)");
			}else{
				System.out.println("WRONG!");
			}
			System.out.flush();
		}
	}
}
0