結果

問題 No.380 悪の台本
ユーザー uwiuwi
提出日時 2016-06-19 17:52:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 509 ms / 1,000 ms
コード長 1,497 bytes
コンパイル時間 3,845 ms
コンパイル使用メモリ 78,496 KB
実行使用メモリ 52,712 KB
最終ジャッジ日時 2024-04-24 14:35:02
合計ジャッジ時間 6,749 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
41,088 KB
testcase_01 AC 114 ms
40,520 KB
testcase_02 AC 131 ms
41,248 KB
testcase_03 AC 129 ms
41,652 KB
testcase_04 AC 313 ms
47,320 KB
testcase_05 AC 404 ms
47,800 KB
testcase_06 AC 362 ms
47,212 KB
testcase_07 AC 509 ms
52,712 KB
testcase_08 AC 185 ms
43,024 KB
testcase_09 AC 324 ms
46,960 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