結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-17 23:26:48 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 4,617 bytes |
| コンパイル時間 | 3,624 ms |
| コンパイル使用メモリ | 77,792 KB |
| 実行使用メモリ | 56,068 KB |
| 最終ジャッジ日時 | 2024-11-06 22:41:37 |
| 合計ジャッジ時間 | 5,965 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 1 WA * 7 |
ソースコード
import java.io.*;
public class Main_yukicoder380 {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// Scanner sc = new Scanner(System.in);
while (true) {
String s;
try {
s = br.readLine();
} catch (IOException e) {
throw new IllegalStateException();
}
// String s = sc.nextLine();
if (s == null) {
break;
}
String ss = s.toLowerCase();
// System.out.println(s);
if (s.startsWith("digi ")) {
if (ss.endsWith("nyo")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("nyo")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("nyo")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("nyo")) {
System.out.println("CORRECT(maybe)");
continue;
}
} else if (s.startsWith("petit ")) {
if (ss.endsWith("nyu")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("nyu")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("nyu")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("nyu")) {
System.out.println("CORRECT(maybe)");
continue;
}
} else if (s.startsWith("rabi ")) {
ss = ss.substring(5);
boolean flag = false;
for (char c : ss.toCharArray()) {
if (isOK(c)) {
flag = true;
break;
}
}
if (flag) {
System.out.println("CORRECT(maybe)");
continue;
}
} else if (s.startsWith("gema ")) {
if (ss.endsWith("gema")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("gema")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("gema")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("gema")) {
System.out.println("CORRECT(maybe)");
continue;
}
} else if (s.startsWith("piyo ")) {
if (ss.endsWith("pyo")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("pyo")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("pyo")) {
System.out.println("CORRECT(maybe)");
continue;
}
if (!isOK(ss.charAt(ss.length() - 1))) {
ss = ss.substring(0, ss.length() - 1);
}
if (ss.endsWith("pyo")) {
System.out.println("CORRECT(maybe)");
continue;
}
}
System.out.println("WRONG!");
}
// sc.close();
}
private static boolean isOK(char ch) {
if (ch >= '0' && ch <= '9') {
return true;
}
if (ch >= 'a' && ch <= 'z') {
return true;
}
if (ch >= 'A' && ch <= 'Z') {
return true;
}
return false;
}
}