結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2016-08-06 18:19:32 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,211 bytes |
コンパイル時間 | 2,425 ms |
コンパイル使用メモリ | 74,960 KB |
実行使用メモリ | 47,660 KB |
最終ジャッジ日時 | 2024-11-06 23:08:03 |
合計ジャッジ時間 | 5,347 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 1 RE * 3 |
ソースコード
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(); } }