結果

問題 No.138 化石のバージョン
ユーザー samplelpmassamplelpmas
提出日時 2016-11-09 03:43:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,090 bytes
コンパイル時間 1,883 ms
コンパイル使用メモリ 75,636 KB
実行使用メモリ 54,532 KB
最終ジャッジ日時 2024-05-03 23:50:20
合計ジャッジ時間 7,077 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
41,364 KB
testcase_01 AC 125 ms
41,180 KB
testcase_02 AC 121 ms
41,272 KB
testcase_03 AC 117 ms
41,168 KB
testcase_04 AC 114 ms
41,280 KB
testcase_05 AC 114 ms
41,208 KB
testcase_06 AC 113 ms
41,232 KB
testcase_07 AC 116 ms
41,344 KB
testcase_08 AC 101 ms
41,288 KB
testcase_09 AC 97 ms
41,376 KB
testcase_10 AC 104 ms
41,156 KB
testcase_11 AC 112 ms
41,148 KB
testcase_12 AC 99 ms
41,080 KB
testcase_13 AC 109 ms
40,972 KB
testcase_14 AC 99 ms
41,488 KB
testcase_15 AC 113 ms
41,384 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 111 ms
41,336 KB
testcase_20 AC 113 ms
41,488 KB
testcase_21 WA -
testcase_22 AC 106 ms
41,132 KB
testcase_23 AC 104 ms
41,116 KB
testcase_24 AC 105 ms
41,140 KB
testcase_25 AC 118 ms
41,228 KB
testcase_26 AC 115 ms
41,220 KB
testcase_27 AC 99 ms
41,248 KB
testcase_28 AC 114 ms
41,136 KB
testcase_29 AC 113 ms
41,360 KB
testcase_30 AC 114 ms
41,420 KB
testcase_31 AC 110 ms
41,264 KB
testcase_32 AC 104 ms
41,316 KB
testcase_33 AC 121 ms
41,180 KB
testcase_34 AC 120 ms
41,056 KB
testcase_35 AC 113 ms
41,344 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