結果
問題 | No.138 化石のバージョン |
ユーザー | AoiroFukurou |
提出日時 | 2015-06-01 14:08:24 |
言語 | Java21 (openjdk 21) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,052 bytes |
コンパイル時間 | 3,580 ms |
コンパイル使用メモリ | 76,568 KB |
実行使用メモリ | 58,084 KB |
最終ジャッジ日時 | 2023-09-20 18:18:08 |
合計ジャッジ時間 | 9,638 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 120 ms
39,772 KB |
testcase_01 | AC | 121 ms
39,840 KB |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | AC | 124 ms
39,812 KB |
testcase_05 | AC | 124 ms
39,784 KB |
testcase_06 | AC | 122 ms
39,564 KB |
testcase_07 | AC | 124 ms
39,436 KB |
testcase_08 | AC | 124 ms
39,532 KB |
testcase_09 | AC | 121 ms
39,564 KB |
testcase_10 | AC | 120 ms
39,156 KB |
testcase_11 | AC | 122 ms
39,648 KB |
testcase_12 | AC | 122 ms
39,336 KB |
testcase_13 | AC | 123 ms
39,452 KB |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | AC | 123 ms
40,016 KB |
testcase_23 | RE | - |
testcase_24 | AC | 123 ms
39,160 KB |
testcase_25 | AC | 122 ms
39,352 KB |
testcase_26 | AC | 122 ms
39,408 KB |
testcase_27 | AC | 121 ms
39,408 KB |
testcase_28 | AC | 123 ms
39,376 KB |
testcase_29 | AC | 122 ms
39,824 KB |
testcase_30 | AC | 122 ms
39,764 KB |
testcase_31 | AC | 122 ms
39,132 KB |
testcase_32 | AC | 121 ms
39,488 KB |
testcase_33 | AC | 121 ms
39,248 KB |
testcase_34 | AC | 121 ms
39,188 KB |
testcase_35 | AC | 121 ms
39,232 KB |
ソースコード
package b2015_5_31; import java.util.Scanner; public class KasekiVer { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s1 = sc.nextLine(); String s2 = sc.nextLine(); String a = ""; String b =""; int t1 = 0; int t2 = 0; int t3 = 0; int t4 = 0; int n1 = 1; int n2 = 1; int n3 = 0; t1 = Integer.parseInt(Nuki(s1, a, n1)); t2 = Integer.parseInt(Nuki(s2, b, n2)); n1+=Nuki(s1, a, n1).length(); n2+=Nuki(s2, b, n2).length(); for(int i = 0; i < 4; i++){ if(n3==3){ System.out.println("YES"); } if(t1 > t2){ System.out.println("YES"); break; }else if(t1 < t2){ System.out.println("NO"); break; }else if(t1 == t2){ a = ""; b =""; t1 = 0; t2 = 0; t1 = Integer.parseInt(Nuki(s1, a, n1)); t2 = Integer.parseInt(Nuki(s2, b, n2)); n1+=Nuki(s1, a, n1).length(); n2+=Nuki(s2, b, n2).length(); n3++; } } } public static String Nuki(String s, String ab, int n){ while(!(s.substring(n-1, n)).equals(".")){ ab+=s.substring(n-1, n); n++; } return ab; } }