結果

問題 No.138 化石のバージョン
ユーザー r.suzukir.suzuki
提出日時 2016-01-01 22:34:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 796 bytes
コンパイル時間 4,608 ms
コンパイル使用メモリ 73,552 KB
実行使用メモリ 57,484 KB
最終ジャッジ日時 2023-08-28 13:36:03
合計ジャッジ時間 8,833 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,768 KB
testcase_01 AC 118 ms
55,528 KB
testcase_02 AC 124 ms
55,464 KB
testcase_03 AC 117 ms
57,484 KB
testcase_04 AC 119 ms
55,612 KB
testcase_05 AC 117 ms
55,820 KB
testcase_06 AC 119 ms
55,740 KB
testcase_07 AC 119 ms
55,644 KB
testcase_08 AC 118 ms
55,640 KB
testcase_09 AC 119 ms
56,024 KB
testcase_10 AC 122 ms
55,732 KB
testcase_11 AC 122 ms
55,636 KB
testcase_12 AC 122 ms
55,584 KB
testcase_13 AC 125 ms
55,640 KB
testcase_14 AC 117 ms
55,636 KB
testcase_15 AC 118 ms
55,924 KB
testcase_16 AC 123 ms
55,432 KB
testcase_17 AC 119 ms
55,704 KB
testcase_18 AC 121 ms
55,600 KB
testcase_19 AC 117 ms
55,984 KB
testcase_20 AC 118 ms
55,656 KB
testcase_21 AC 118 ms
55,656 KB
testcase_22 AC 120 ms
55,780 KB
testcase_23 AC 118 ms
55,864 KB
testcase_24 AC 119 ms
55,624 KB
testcase_25 AC 119 ms
55,620 KB
testcase_26 AC 121 ms
56,116 KB
testcase_27 AC 119 ms
55,804 KB
testcase_28 AC 118 ms
55,676 KB
testcase_29 AC 120 ms
55,536 KB
testcase_30 AC 121 ms
55,756 KB
testcase_31 AC 120 ms
56,016 KB
testcase_32 AC 119 ms
56,036 KB
testcase_33 AC 120 ms
55,828 KB
testcase_34 AC 117 ms
55,516 KB
testcase_35 AC 118 ms
55,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class Version {
	int[] num = new int[3];

	static boolean checkVersion(int[] num1, int[] num2, int i) {
		if (i > 2 || num1[i] > num2[i]) {
			return true;
		} else if (num1[i] < num2[i]) {
			return false;
		} else {
			return checkVersion(num1, num2, ++i);
		}
	}

}

public class No_138 {

	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		String[] s1 = sc.nextLine().split("\\.");
		String[] s2 = sc.nextLine().split("\\.");

		Version old = new Version();
		Version set = new Version();

		for (int i = 0; i < 3; i++) {
			old.num[i] = Integer.parseInt(s1[i]);
			set.num[i] = Integer.parseInt(s2[i]);
		}

		if (Version.checkVersion(old.num, set.num, 0)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

}
0