結果

問題 No.138 化石のバージョン
ユーザー omc-testomc-test
提出日時 2016-08-03 14:48:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 1,318 bytes
コンパイル時間 2,166 ms
コンパイル使用メモリ 74,420 KB
実行使用メモリ 56,616 KB
最終ジャッジ日時 2023-08-28 13:43:35
合計ジャッジ時間 7,850 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,016 KB
testcase_01 AC 114 ms
56,032 KB
testcase_02 AC 115 ms
55,784 KB
testcase_03 AC 114 ms
56,212 KB
testcase_04 AC 114 ms
55,940 KB
testcase_05 AC 115 ms
55,828 KB
testcase_06 AC 114 ms
56,032 KB
testcase_07 AC 115 ms
55,616 KB
testcase_08 AC 114 ms
55,680 KB
testcase_09 AC 118 ms
55,772 KB
testcase_10 AC 114 ms
56,032 KB
testcase_11 AC 115 ms
55,760 KB
testcase_12 AC 114 ms
56,192 KB
testcase_13 AC 117 ms
55,624 KB
testcase_14 AC 114 ms
56,036 KB
testcase_15 AC 114 ms
55,356 KB
testcase_16 AC 115 ms
55,996 KB
testcase_17 AC 115 ms
55,868 KB
testcase_18 AC 114 ms
55,836 KB
testcase_19 AC 115 ms
55,464 KB
testcase_20 AC 114 ms
56,308 KB
testcase_21 AC 114 ms
53,632 KB
testcase_22 AC 113 ms
55,632 KB
testcase_23 AC 115 ms
55,936 KB
testcase_24 AC 114 ms
55,632 KB
testcase_25 AC 112 ms
56,176 KB
testcase_26 AC 114 ms
55,744 KB
testcase_27 AC 115 ms
56,068 KB
testcase_28 AC 113 ms
55,876 KB
testcase_29 AC 113 ms
56,084 KB
testcase_30 AC 114 ms
55,832 KB
testcase_31 AC 114 ms
56,616 KB
testcase_32 AC 114 ms
55,628 KB
testcase_33 AC 114 ms
55,716 KB
testcase_34 AC 114 ms
56,352 KB
testcase_35 AC 119 ms
54,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<Integer> listKaseki = getVersion(sc.next());
		List<Integer> listJudge = getVersion(sc.next());
		sc.close();
		if(JudgeVersion(listKaseki, listJudge)){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}

	public static List<Integer> getVersion(String version){
		List<Integer> list = new ArrayList<Integer>();
		int index = version.indexOf(".");
		list.add(Integer.parseInt(version.substring(0, index)));
		String version2 = version.substring(index + 1);
		index = version2.indexOf(".");
		list.add(Integer.parseInt(version2.substring(0, index)));
		list.add(Integer.parseInt(version2.substring(index + 1)));
		return list;
	}

	public static boolean JudgeVersion(List<Integer> listKaseki, List<Integer> listJudge){
		if(listKaseki.get(0) < listJudge.get(0)){
			return false;
		}else if(listKaseki.get(0) > listJudge.get(0)){
			return true;
		}else{
			if(listKaseki.get(1) < listJudge.get(1)){
				return false;
			}else if(listKaseki.get(1) > listJudge.get(1)){
				return true;
			}else{
				if(listKaseki.get(2) < listJudge.get(2)){
					return false;
				}else{
					return true;
				}
			}
		}
	}
}
0