結果

問題 No.380 悪の台本
ユーザー ぴろずぴろず
提出日時 2016-06-17 22:39:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 837 bytes
コンパイル時間 1,808 ms
コンパイル使用メモリ 74,256 KB
実行使用メモリ 55,128 KB
最終ジャッジ日時 2024-04-24 14:14:04
合計ジャッジ時間 5,266 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
40,820 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 942 ms
55,128 KB
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package no380;

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);
		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!");
			}
		}
	}

}
0