結果

問題 No.380 悪の台本
ユーザー jp_stejp_ste
提出日時 2016-08-06 18:19:32
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,211 bytes
コンパイル時間 1,920 ms
コンパイル使用メモリ 74,976 KB
実行使用メモリ 47,728 KB
最終ジャッジ日時 2024-04-24 14:42:51
合計ジャッジ時間 4,559 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
40,244 KB
testcase_01 RE -
testcase_02 AC 116 ms
41,340 KB
testcase_03 AC 109 ms
39,896 KB
testcase_04 AC 318 ms
47,552 KB
testcase_05 AC 440 ms
47,520 KB
testcase_06 WA -
testcase_07 RE -
testcase_08 AC 221 ms
42,828 KB
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

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);
    static final String C = "CORRECT (maybe)";
    static final String W = "WRONG!";
    
    public static void main(String[] args) throws IOException {
        String names[] = { "digi", "petit", "rabi", "gema", "piyo" };
        
        String reges[] = new String[5];
        reges[0] = ".*nyo[ -/:-@\\[-\\`\\{-\\~]{0,3}$";
        reges[1] = ".*nyu[ -/:-@\\[-\\`\\{-\\~]{0,3}$";
        reges[2] = ".*[a-z0-9A-Z].*";
        reges[3] = ".*gema[ -/:-@\\[-\\`\\{-\\~]{0,3}$";
        reges[4] = ".*pyo[ -/:-@\\[-\\`\\{-\\~]{0,3}$";
        
        while(scan.hasNextLine()) {
            String tmp[] = scan.nextLine().split(" ", 2);
            String name = tmp[0];
            String words = tmp[1].toLowerCase();
            
            for(int i=0; i<names.length; i++) {
                if(name.equals(names[i])) {
                    out.println(words.matches(reges[i]) ? C : W);
                    break;    
                }
            }
        }
        out.flush();
    }
}
0