結果

問題 No.138 化石のバージョン
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-05-15 00:31:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 613 bytes
コンパイル時間 1,907 ms
コンパイル使用メモリ 72,004 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-09-10 20:50:01
合計ジャッジ時間 7,605 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,720 KB
testcase_01 AC 118 ms
55,956 KB
testcase_02 AC 118 ms
55,812 KB
testcase_03 AC 119 ms
55,784 KB
testcase_04 AC 118 ms
55,772 KB
testcase_05 AC 117 ms
55,360 KB
testcase_06 AC 117 ms
55,512 KB
testcase_07 AC 117 ms
55,592 KB
testcase_08 AC 117 ms
55,792 KB
testcase_09 AC 117 ms
55,736 KB
testcase_10 AC 117 ms
55,660 KB
testcase_11 AC 118 ms
55,656 KB
testcase_12 AC 117 ms
56,208 KB
testcase_13 AC 115 ms
55,636 KB
testcase_14 AC 117 ms
55,724 KB
testcase_15 AC 116 ms
55,548 KB
testcase_16 AC 116 ms
56,168 KB
testcase_17 AC 116 ms
55,552 KB
testcase_18 AC 116 ms
55,584 KB
testcase_19 AC 118 ms
55,352 KB
testcase_20 AC 118 ms
55,732 KB
testcase_21 AC 117 ms
56,040 KB
testcase_22 AC 117 ms
55,588 KB
testcase_23 AC 121 ms
55,696 KB
testcase_24 AC 117 ms
55,576 KB
testcase_25 AC 117 ms
55,864 KB
testcase_26 AC 118 ms
55,544 KB
testcase_27 AC 117 ms
55,648 KB
testcase_28 AC 117 ms
55,724 KB
testcase_29 AC 117 ms
55,588 KB
testcase_30 AC 117 ms
55,596 KB
testcase_31 AC 117 ms
55,688 KB
testcase_32 AC 118 ms
55,748 KB
testcase_33 AC 118 ms
55,940 KB
testcase_34 AC 115 ms
55,428 KB
testcase_35 AC 115 ms
55,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String[] v1 = in.next().split("\\.");
        String[] v2 = in.next().split("\\.");

        String ans = "NO";

        if(compare(v1, v2) >= 0)
            ans = "YES";

        System.out.println(ans);
    }

    public static int compare(String[] a, String[] b) {
        for(int i = 0; i < 3; i++) {
            int k = Integer.parseInt(a[i]);
            int t = Integer.parseInt(b[i]);
            if(k != t)
                return k - t;
        }
        return 0;
    }
}
0