結果

問題 No.380 悪の台本
ユーザー ym678ym678
提出日時 2016-08-31 17:26:20
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 829 bytes
コンパイル時間 2,126 ms
コンパイル使用メモリ 74,124 KB
実行使用メモリ 55,476 KB
最終ジャッジ日時 2024-04-24 14:44:42
合計ジャッジ時間 5,344 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String names[] = {"digi","petit","rabi","gema","piyo"};
		String check[] = new String[5];
		check[0] = "digi .*[nN][yY][oO][-^¥@[;:],./_~!]{0,3}";
		check[1] = "petit .*[nN][yY][uU][-^¥@[;:],./_~!]{0,3}";
		check[2] = "rabi /w.*";
		check[3] = "gema .*[gG][eE][mM][aA][-^¥@[;:],./_~!]{0,3}";
		check[4] = "piyo .*[pP][yY][oO][-^¥@[;:],./_~!]{0,3}";
		while(sc.hasNextLine()){
			String line = sc.nextLine();
			String[] name = line.split(" ",2);
			for(int i=0; i<5; i++){
			    if(name[0].matches(names[i])){
			    	if(line.matches(check[i])){
			    		System.out.println("CORRECT (maybe)");
			    	}else{			    	
			    		System.out.println("WRONG!");
			    	}
			    }				
			}
		}		
	}
}
0