結果

問題 No.138 化石のバージョン
ユーザー omc-testomc-test
提出日時 2016-08-03 14:46:23
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,318 bytes
コンパイル時間 1,837 ms
コンパイル使用メモリ 77,964 KB
実行使用メモリ 41,304 KB
最終ジャッジ日時 2024-04-24 15:13:14
合計ジャッジ時間 6,505 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
40,044 KB
testcase_01 AC 107 ms
39,872 KB
testcase_02 AC 105 ms
39,964 KB
testcase_03 AC 93 ms
39,764 KB
testcase_04 AC 107 ms
41,132 KB
testcase_05 AC 103 ms
40,928 KB
testcase_06 AC 98 ms
39,808 KB
testcase_07 AC 104 ms
40,584 KB
testcase_08 AC 97 ms
39,316 KB
testcase_09 AC 95 ms
40,144 KB
testcase_10 AC 112 ms
41,004 KB
testcase_11 AC 105 ms
40,980 KB
testcase_12 AC 95 ms
39,736 KB
testcase_13 AC 109 ms
41,016 KB
testcase_14 AC 107 ms
41,096 KB
testcase_15 AC 90 ms
39,664 KB
testcase_16 AC 95 ms
39,848 KB
testcase_17 AC 96 ms
40,272 KB
testcase_18 AC 109 ms
39,872 KB
testcase_19 AC 108 ms
41,140 KB
testcase_20 WA -
testcase_21 AC 106 ms
41,068 KB
testcase_22 AC 103 ms
40,832 KB
testcase_23 AC 101 ms
40,912 KB
testcase_24 AC 97 ms
39,328 KB
testcase_25 AC 104 ms
40,244 KB
testcase_26 AC 109 ms
40,216 KB
testcase_27 AC 112 ms
41,292 KB
testcase_28 AC 101 ms
39,808 KB
testcase_29 AC 107 ms
41,056 KB
testcase_30 AC 109 ms
41,208 KB
testcase_31 AC 106 ms
40,820 KB
testcase_32 AC 108 ms
40,960 KB
testcase_33 AC 90 ms
39,884 KB
testcase_34 AC 107 ms
41,304 KB
testcase_35 AC 107 ms
40,632 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(1) < listJudge.get(1)){
					return false;
				}else{
					return true;
				}
			}
		}
	}
}
0