結果
問題 |
No.380 悪の台本
|
ユーザー |
|
提出日時 | 2016-06-19 19:51:18 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 353 ms / 1,000 ms |
コード長 | 1,556 bytes |
コンパイル時間 | 3,697 ms |
コンパイル使用メモリ | 78,692 KB |
実行使用メモリ | 46,092 KB |
最終ジャッジ日時 | 2024-11-06 22:59:46 |
合計ジャッジ時間 | 6,209 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 |
ソースコード
package q3xx; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StringReader; import java.util.Arrays; public class Q380LL { static BufferedReader br; static PrintWriter out; static String INPUT = ""; static void solve() throws Exception { String C = "CORRECT (maybe)"; String W = "WRONG!"; while(true){ String line = br.readLine(); if(line == null)break; if(line.indexOf(' ') == -1){ out.println(W); continue; } String[] sp = line.split(" ", 2); String se = sp[1].toLowerCase(); if(sp[0].equals("digi")){ out.println(se.matches("^.*nyo([^A-Za-z0-9]{1,3})?$") ? C : W); }else if(sp[0].equals("petit")){ out.println(se.matches("^.*nyu([^A-Za-z0-9]{1,3})?$") ? C : W); }else if(sp[0].equals("rabi")){ out.println(se.matches("^.*[A-Za-z0-9].*$") ? C : W); }else if(sp[0].equals("gema")){ out.println(se.matches("^.*gema([^A-Za-z0-9]{1,3})?$") ? C : W); }else if(sp[0].equals("piyo")){ out.println(se.matches("^.*pyo([^A-Za-z0-9]{1,3})?$") ? C : W); }else{ out.println(W); } } } public static void main(String[] args) throws Exception { long S = System.currentTimeMillis(); br = new BufferedReader(INPUT.isEmpty() ? new InputStreamReader(System.in) : new StringReader(INPUT)); out = new PrintWriter(System.out); solve(); out.flush(); long G = System.currentTimeMillis(); tr(G-S+"ms"); } static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); } }