結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
40,532 KB
testcase_01 AC 110 ms
40,296 KB
testcase_02 AC 107 ms
40,180 KB
testcase_03 AC 103 ms
39,972 KB
testcase_04 AC 252 ms
45,328 KB
testcase_05 AC 356 ms
47,112 KB
testcase_06 AC 342 ms
46,648 KB
testcase_07 AC 992 ms
54,832 KB
testcase_08 AC 190 ms
42,456 KB
testcase_09 AC 271 ms
46,444 KB
権限があれば一括ダウンロードができます

ソースコード

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