結果

問題 No.380 悪の台本
ユーザー uwiuwi
提出日時 2016-06-19 17:52:59
言語 Java19
(openjdk 21)
結果
AC  
実行時間 549 ms / 1,000 ms
コード長 1,497 bytes
コンパイル時間 4,127 ms
コンパイル使用メモリ 75,948 KB
実行使用メモリ 66,500 KB
最終ジャッジ日時 2023-08-06 19:55:24
合計ジャッジ時間 7,308 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,700 KB
testcase_01 AC 132 ms
55,860 KB
testcase_02 AC 126 ms
56,212 KB
testcase_03 AC 125 ms
55,632 KB
testcase_04 AC 325 ms
61,708 KB
testcase_05 AC 466 ms
60,424 KB
testcase_06 AC 394 ms
60,904 KB
testcase_07 AC 549 ms
66,500 KB
testcase_08 AC 222 ms
57,364 KB
testcase_09 AC 348 ms
61,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package q3xx;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Q380L21 {
	static Scanner in;
	static PrintWriter out;
	static String INPUT = "";
	
	static void solve()
	{
		String C = "CORRECT (maybe)";
		String W = "WRONG!";
		while(in.hasNextLine()){
			String line = in.nextLine();
			if(line.indexOf(' ') == -1){
				out.println(W);
				continue;
			}
			String[] sp = line.split(" ", 2);
			String se = sp[1].toLowerCase();
			if(sp[0].equals("digi")){
				out.println(se.matches("^.*nyo([^A-Za-z0-9]{1,3})?$") ? C : W);
			}else if(sp[0].equals("petit")){
				out.println(se.matches("^.*nyu([^A-Za-z0-9]{1,3})?$") ? C : W);
			}else if(sp[0].equals("rabi")){
				out.println(se.matches("^.*[A-Za-z0-9].*$") ? C : W);
			}else if(sp[0].equals("gema")){
				out.println(se.matches("^.*gema([^A-Za-z0-9]{1,3})?$") ? C : W);
			}else if(sp[0].equals("piyo")){
				out.println(se.matches("^.*pyo([^A-Za-z0-9]{1,3})?$") ? C : W);
			}else{
				out.println(W);
			}
		}

	}
	
	public static void main(String[] args) throws Exception
	{
		in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
		out = new PrintWriter(System.out);
		
		solve();
		out.flush();
	}
	
	static int ni() { return Integer.parseInt(in.next()); }
	static long nl() { return Long.parseLong(in.next()); }
	static double nd() { return Double.parseDouble(in.next()); }
	static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }
}
0