結果
問題 | No.380 悪の台本 |
ユーザー | uwi |
提出日時 | 2016-06-19 19:51:18 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 347 ms / 1,000 ms |
コード長 | 1,556 bytes |
コンパイル時間 | 3,805 ms |
コンパイル使用メモリ | 78,816 KB |
実行使用メモリ | 45,564 KB |
最終ジャッジ日時 | 2024-04-24 14:35:19 |
合計ジャッジ時間 | 6,281 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 92 ms
38,156 KB |
testcase_01 | AC | 96 ms
38,276 KB |
testcase_02 | AC | 81 ms
37,972 KB |
testcase_03 | AC | 84 ms
38,200 KB |
testcase_04 | AC | 259 ms
44,468 KB |
testcase_05 | AC | 347 ms
45,564 KB |
testcase_06 | AC | 294 ms
45,344 KB |
testcase_07 | AC | 222 ms
42,900 KB |
testcase_08 | AC | 126 ms
39,460 KB |
testcase_09 | AC | 248 ms
44,012 KB |
ソースコード
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)); } }