結果

問題 No.138 化石のバージョン
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-29 17:43:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 1,071 bytes
コンパイル時間 2,460 ms
コンパイル使用メモリ 77,664 KB
実行使用メモリ 51,032 KB
最終ジャッジ日時 2023-08-28 13:51:43
合計ジャッジ時間 6,006 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
50,568 KB
testcase_01 AC 60 ms
50,540 KB
testcase_02 AC 59 ms
50,584 KB
testcase_03 AC 59 ms
50,600 KB
testcase_04 AC 60 ms
50,632 KB
testcase_05 AC 61 ms
50,600 KB
testcase_06 AC 59 ms
50,632 KB
testcase_07 AC 60 ms
50,652 KB
testcase_08 AC 60 ms
50,832 KB
testcase_09 AC 58 ms
50,692 KB
testcase_10 AC 59 ms
50,648 KB
testcase_11 AC 59 ms
50,600 KB
testcase_12 AC 59 ms
50,544 KB
testcase_13 AC 59 ms
50,616 KB
testcase_14 AC 58 ms
50,640 KB
testcase_15 AC 59 ms
50,684 KB
testcase_16 AC 58 ms
50,576 KB
testcase_17 AC 60 ms
50,504 KB
testcase_18 AC 59 ms
50,572 KB
testcase_19 AC 61 ms
50,500 KB
testcase_20 AC 59 ms
50,600 KB
testcase_21 AC 60 ms
50,676 KB
testcase_22 AC 59 ms
50,496 KB
testcase_23 AC 59 ms
50,632 KB
testcase_24 AC 58 ms
50,600 KB
testcase_25 AC 59 ms
50,680 KB
testcase_26 AC 59 ms
50,548 KB
testcase_27 AC 60 ms
50,716 KB
testcase_28 AC 60 ms
51,032 KB
testcase_29 AC 60 ms
50,952 KB
testcase_30 AC 60 ms
50,820 KB
testcase_31 AC 60 ms
50,592 KB
testcase_32 AC 60 ms
50,552 KB
testcase_33 AC 59 ms
50,476 KB
testcase_34 AC 60 ms
50,620 KB
testcase_35 AC 60 ms
50,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.stream.Stream;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String[] S = reader.readLine().split("\\.");
        String[] M = reader.readLine().split("\\.");

        int[] possibleOldVersion = Stream.of(S).mapToInt(Integer::parseInt).toArray();
        int[] targetVersion = Stream.of(M).mapToInt(Integer::parseInt).toArray();

        for (int i = 0; i < 3; i++) {

            if (possibleOldVersion[i] < targetVersion[i]) {
                System.out.println("NO");
                break;
            } else if (possibleOldVersion[i] == targetVersion[i]) {
                if (i==2) {
                    System.out.println("YES");
                }
            } else {

                System.out.println("YES");
                break;
            }
        }
    }
}
0