結果

問題 No.380 悪の台本
ユーザー hiromi_ayasehiromi_ayase
提出日時 2016-06-17 22:40:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 952 bytes
コンパイル時間 2,130 ms
コンパイル使用メモリ 74,724 KB
実行使用メモリ 52,948 KB
最終ジャッジ日時 2024-04-24 14:14:24
合計ジャッジ時間 5,237 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			String name = sc.next();
			String line = sc.nextLine().toLowerCase();
			boolean ok = false;
			if (name.equals("digi")) {
				line = line.replaceAll("[^\\w]{0,3}$", "");
				ok = line.endsWith("nyo");
			} else if (name.equals("petit")) {
				line = line.replaceAll("[^\\w]{0,3}$", "");
				ok = line.endsWith("nyu");
			} else if (name.equals("gema")) {
				line = line.replaceAll("[^\\w]{0,3}$", "");
				ok = line.endsWith("gema");
			} else if (name.equals("piyo")) {
				line = line.replaceAll("[^\\w]{0,3}$", "");
				ok = line.endsWith("pyo");
			} else if (name.equals("rabi")) {
				ok = line.matches(".*[a-z].*");
			}
			System.out.println(ok ? "CORRECT (maybe)" : "WRONG!");
		}
	}

}
0