結果

問題 No.138 化石のバージョン
ユーザー samplelpmassamplelpmas
提出日時 2016-11-09 03:45:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 1,091 bytes
コンパイル時間 2,919 ms
コンパイル使用メモリ 71,848 KB
実行使用メモリ 56,352 KB
最終ジャッジ日時 2023-08-28 13:48:06
合計ジャッジ時間 8,635 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,008 KB
testcase_01 AC 120 ms
56,052 KB
testcase_02 AC 119 ms
56,068 KB
testcase_03 AC 121 ms
55,820 KB
testcase_04 AC 120 ms
56,352 KB
testcase_05 AC 118 ms
55,652 KB
testcase_06 AC 119 ms
55,804 KB
testcase_07 AC 119 ms
55,768 KB
testcase_08 AC 118 ms
55,716 KB
testcase_09 AC 118 ms
53,796 KB
testcase_10 AC 117 ms
55,932 KB
testcase_11 AC 117 ms
55,396 KB
testcase_12 AC 117 ms
55,816 KB
testcase_13 AC 117 ms
56,012 KB
testcase_14 AC 115 ms
55,460 KB
testcase_15 AC 117 ms
55,544 KB
testcase_16 AC 118 ms
56,048 KB
testcase_17 AC 117 ms
56,032 KB
testcase_18 AC 119 ms
55,588 KB
testcase_19 AC 121 ms
55,860 KB
testcase_20 AC 118 ms
55,992 KB
testcase_21 AC 117 ms
55,756 KB
testcase_22 AC 118 ms
56,100 KB
testcase_23 AC 116 ms
55,968 KB
testcase_24 AC 115 ms
55,580 KB
testcase_25 AC 116 ms
55,388 KB
testcase_26 AC 117 ms
55,764 KB
testcase_27 AC 116 ms
55,952 KB
testcase_28 AC 117 ms
55,984 KB
testcase_29 AC 117 ms
55,636 KB
testcase_30 AC 121 ms
55,476 KB
testcase_31 AC 117 ms
55,920 KB
testcase_32 AC 117 ms
55,912 KB
testcase_33 AC 118 ms
55,968 KB
testcase_34 AC 117 ms
56,024 KB
testcase_35 AC 117 ms
56,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String[] oldVersionString = sc.next().split("\\.");
        String[] targetVersionString = sc.next().split("\\.");

        int[] oldVersion = new int[oldVersionString.length];
        int[] targetVersion = new int[targetVersionString.length];

        for (int i = 0; i < oldVersionString.length; i++) {

            oldVersion[i] = Integer.parseInt(oldVersionString[i]);
            targetVersion[i] = Integer.parseInt(targetVersionString[i]);

        }

        boolean isOld = false;

        if (targetVersion[0] < oldVersion[0]) {
            isOld = true;
        }

        if ((targetVersion[0] == oldVersion[0]) && (targetVersion[1] < oldVersion[1])) {
            isOld = true;
        }

        if ((targetVersion[0] == oldVersion[0]) && (targetVersion[1] == oldVersion[1]) &&
                (targetVersion[2] <= oldVersion[2])) {
            isOld = true;
        }

        System.out.println(isOld ? "YES" : "NO");

    }

}
0