結果

問題 No.380 悪の台本
ユーザー jp_stejp_ste
提出日時 2016-08-06 18:24:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,275 bytes
コンパイル時間 1,901 ms
コンパイル使用メモリ 74,224 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-04-24 14:42:56
合計ジャッジ時間 5,078 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
40,988 KB
testcase_01 WA -
testcase_02 AC 109 ms
41,136 KB
testcase_03 AC 99 ms
39,952 KB
testcase_04 AC 284 ms
47,264 KB
testcase_05 AC 388 ms
48,248 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 191 ms
42,768 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    
    static Scanner scan = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        String names[] = { "digi", "petit", "rabi", "gema", "piyo" };
        
        String reges[] = new String[5];
        reges[0] = "digi .*[nN][yY][oO][ -/:-@\\[-\\`\\{-\\~]{0,3}$";
        reges[1] = "petit .*[nN][yY][uU][ -/:-@\\[-\\`\\{-\\~]{0,3}$";
        reges[2] = "rabi .*[a-z0-9A-Z].*";
        reges[3] = "gema .*[gG][eE][mM][aA][ -/:-@\\[-\\`\\{-\\~]{0,3}$";
        reges[4] = "piyo .*[pP][yY][oO][ -/:-@\\[-\\`\\{-\\~]{0,3}$";
        
        while(scan.hasNextLine()) {
            String line = scan.nextLine();
            String name = line.split(" ", 2)[0];
            
            for(int i=0; i<names.length; i++) {
                if(name.equals(names[i])) {
                    if(line.matches(reges[i])) {
                        out.println("CORRECT (maybe)");
                    } else {
                        out.println("WRONG!");
                    }
                    break;    
                }
            }
        }
        out.flush();
    }
}
0