結果

問題 No.138 化石のバージョン
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-05-15 00:22:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 918 bytes
コンパイル時間 1,884 ms
コンパイル使用メモリ 72,188 KB
実行使用メモリ 56,444 KB
最終ジャッジ日時 2023-09-10 20:49:17
合計ジャッジ時間 7,495 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,764 KB
testcase_01 AC 118 ms
55,796 KB
testcase_02 AC 117 ms
55,896 KB
testcase_03 AC 117 ms
55,696 KB
testcase_04 AC 117 ms
56,080 KB
testcase_05 AC 118 ms
56,008 KB
testcase_06 AC 122 ms
55,400 KB
testcase_07 AC 117 ms
55,504 KB
testcase_08 AC 118 ms
56,052 KB
testcase_09 AC 117 ms
55,592 KB
testcase_10 AC 118 ms
55,700 KB
testcase_11 AC 117 ms
55,724 KB
testcase_12 AC 118 ms
55,904 KB
testcase_13 AC 115 ms
55,960 KB
testcase_14 AC 115 ms
55,632 KB
testcase_15 AC 115 ms
55,736 KB
testcase_16 AC 116 ms
55,768 KB
testcase_17 AC 116 ms
55,912 KB
testcase_18 AC 113 ms
55,804 KB
testcase_19 AC 113 ms
56,444 KB
testcase_20 AC 115 ms
55,848 KB
testcase_21 AC 114 ms
55,880 KB
testcase_22 AC 113 ms
55,700 KB
testcase_23 AC 114 ms
55,796 KB
testcase_24 AC 121 ms
55,924 KB
testcase_25 AC 115 ms
55,644 KB
testcase_26 AC 116 ms
55,784 KB
testcase_27 AC 116 ms
56,068 KB
testcase_28 AC 117 ms
55,836 KB
testcase_29 AC 116 ms
55,492 KB
testcase_30 AC 115 ms
55,632 KB
testcase_31 AC 117 ms
55,752 KB
testcase_32 AC 117 ms
55,472 KB
testcase_33 AC 117 ms
53,824 KB
testcase_34 AC 117 ms
55,936 KB
testcase_35 AC 117 ms
55,592 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 = "";
        int[] k = new int[3];
        int[] t = new int[3];
        for(int i = 0; i < 3; i++) {
            k[i] = Integer.parseInt(v1[i]);
            t[i] = Integer.parseInt(v2[i]);
        }

        if(k[0] > t[0]) {
            ans = "YES";
        } else if(k[0] == t[0]) {
            if(k[1] > t[1]) {
                ans = "YES";
            } else if(k[1] == t[1]) {
                if(k[2] >= t[2]) {
                    ans = "YES";
                } else {
                    ans = "NO";
                }
            } else {
                ans = "NO";
            }
        } else {
            ans = "NO";
        }

        System.out.println(ans);
    }
}
0