結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
40,732 KB
testcase_01 AC 105 ms
40,884 KB
testcase_02 AC 110 ms
40,768 KB
testcase_03 AC 111 ms
40,836 KB
testcase_04 AC 114 ms
40,936 KB
testcase_05 AC 105 ms
40,964 KB
testcase_06 AC 106 ms
39,964 KB
testcase_07 AC 109 ms
41,100 KB
testcase_08 AC 108 ms
40,672 KB
testcase_09 AC 98 ms
40,016 KB
testcase_10 AC 107 ms
40,812 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 95 ms
39,684 KB
testcase_14 RE -
testcase_15 AC 109 ms
40,916 KB
testcase_16 AC 95 ms
39,756 KB
testcase_17 AC 96 ms
40,280 KB
testcase_18 AC 95 ms
40,024 KB
testcase_19 AC 90 ms
39,704 KB
testcase_20 WA -
testcase_21 AC 109 ms
41,260 KB
testcase_22 RE -
testcase_23 AC 111 ms
39,980 KB
testcase_24 AC 94 ms
40,044 KB
testcase_25 AC 97 ms
40,024 KB
testcase_26 AC 98 ms
40,108 KB
testcase_27 AC 107 ms
40,724 KB
testcase_28 AC 107 ms
40,136 KB
testcase_29 RE -
testcase_30 AC 95 ms
40,308 KB
testcase_31 RE -
testcase_32 AC 104 ms
40,888 KB
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
権限があれば一括ダウンロードができます

ソースコード

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);
		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