結果

問題 No.380 悪の台本
ユーザー GrenacheGrenache
提出日時 2016-06-17 23:32:50
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 4,634 bytes
コンパイル時間 4,316 ms
コンパイル使用メモリ 74,028 KB
実行使用メモリ 62,768 KB
最終ジャッジ日時 2023-08-06 19:39:58
合計ジャッジ時間 6,612 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 43 ms
49,168 KB
testcase_02 AC 42 ms
49,396 KB
testcase_03 AC 43 ms
49,332 KB
testcase_04 AC 146 ms
53,784 KB
testcase_05 AC 207 ms
55,688 KB
testcase_06 AC 204 ms
53,388 KB
testcase_07 AC 575 ms
62,768 KB
testcase_08 AC 95 ms
54,840 KB
testcase_09 AC 160 ms
53,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;


public class Main_yukicoder380 {

    public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

//        Scanner sc = new Scanner(System.in);

        while (true) {
        	String s;
			try {
				s = br.readLine();
			} catch (IOException e) {
				throw new IllegalStateException();
			}

//        	String s = sc.nextLine();
        	if (s == null) {
        		break;
        	}
        	String ss = s.toLowerCase();

//        	System.out.println(s);

        	if (s.startsWith("digi ")) {
        		if (ss.endsWith("nyo")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("nyo")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("nyo")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("nyo")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        	} else if (s.startsWith("petit ")) {
        		if (ss.endsWith("nyu")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("nyu")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("nyu")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("nyu")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        	} else if (s.startsWith("rabi ")) {
        		ss = ss.substring(5);
        		boolean flag = false;
        		for (char c : ss.toCharArray()) {
        			if (isOK(c)) {
        				flag = true;
        				break;
        			}
        		}

        		if (flag) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        	} else if (s.startsWith("gema ")) {
        		if (ss.endsWith("gema")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("gema")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("gema")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("gema")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        	} else if (s.startsWith("piyo ")) {
        		if (ss.endsWith("pyo")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("pyo")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("pyo")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        		if (!isOK(ss.charAt(ss.length() - 1))) {
        			ss = ss.substring(0, ss.length() - 1);
        		}
        		if (ss.endsWith("pyo")) {
        			System.out.println("CORRECT (maybe)");
        			continue;
        		}
        	}
    		System.out.println("WRONG!");
        }

//        sc.close();
    }

	private static boolean isOK(char ch) {
		if (ch >= '0' && ch <= '9') {
			return true;
		}
		if (ch >= 'a' && ch <= 'z') {
			return true;
		}
		if (ch >= 'A' && ch <= 'Z') {
			return true;
		}

		return false;
	}
}
0