結果

問題 No.138 化石のバージョン
ユーザー YatsukuYatsuku
提出日時 2015-12-13 01:42:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 769 bytes
コンパイル時間 2,056 ms
コンパイル使用メモリ 72,676 KB
実行使用メモリ 56,528 KB
最終ジャッジ日時 2023-08-28 13:34:40
合計ジャッジ時間 7,459 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
55,832 KB
testcase_01 AC 114 ms
55,828 KB
testcase_02 AC 115 ms
56,052 KB
testcase_03 AC 114 ms
55,704 KB
testcase_04 AC 115 ms
55,784 KB
testcase_05 AC 114 ms
56,092 KB
testcase_06 AC 115 ms
55,908 KB
testcase_07 AC 114 ms
55,728 KB
testcase_08 AC 116 ms
53,780 KB
testcase_09 AC 114 ms
55,652 KB
testcase_10 AC 114 ms
53,728 KB
testcase_11 AC 113 ms
55,996 KB
testcase_12 AC 114 ms
55,628 KB
testcase_13 AC 113 ms
55,736 KB
testcase_14 AC 114 ms
55,348 KB
testcase_15 AC 114 ms
55,596 KB
testcase_16 AC 115 ms
55,756 KB
testcase_17 AC 114 ms
55,512 KB
testcase_18 AC 114 ms
55,928 KB
testcase_19 AC 115 ms
55,620 KB
testcase_20 AC 116 ms
55,592 KB
testcase_21 AC 116 ms
55,684 KB
testcase_22 AC 116 ms
55,516 KB
testcase_23 AC 114 ms
55,396 KB
testcase_24 AC 119 ms
55,540 KB
testcase_25 AC 115 ms
55,760 KB
testcase_26 AC 113 ms
55,880 KB
testcase_27 AC 115 ms
56,232 KB
testcase_28 AC 113 ms
55,796 KB
testcase_29 AC 113 ms
56,192 KB
testcase_30 AC 113 ms
56,528 KB
testcase_31 AC 113 ms
55,824 KB
testcase_32 AC 113 ms
56,052 KB
testcase_33 AC 114 ms
55,944 KB
testcase_34 AC 112 ms
55,804 KB
testcase_35 AC 113 ms
56,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class No_138 {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);		

		String[] old_ver = stdIn.next().split("\\.");
		String[] ver = stdIn.next().split("\\.");

		int count = 0;
		boolean flag = true;
		for (int i = 0; i < 3; i++) {
			if (Integer.parseInt(old_ver[i]) > Integer.parseInt(ver[i])) {
				if ( flag ) {
					System.out.println("YES");	
					System.exit(0);
				}
			} else if (Integer.parseInt(old_ver[i]) != Integer.parseInt(ver[i])){
				flag = false;
			} else if (Integer.parseInt(old_ver[i]) == Integer.parseInt(ver[i])) {
                                count++;
				if ( count == 3 ) {
					System.out.println("YES");
					System.exit(0);
				}
			}
		}
		System.out.println("NO");
	}
}
0