結果

問題 No.138 化石のバージョン
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-20 15:14:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 2,234 ms
コンパイル使用メモリ 73,940 KB
実行使用メモリ 41,888 KB
最終ジャッジ日時 2024-05-01 07:54:32
合計ジャッジ時間 7,994 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,316 KB
testcase_01 AC 130 ms
41,468 KB
testcase_02 AC 130 ms
41,280 KB
testcase_03 AC 128 ms
41,252 KB
testcase_04 AC 127 ms
41,280 KB
testcase_05 AC 129 ms
41,056 KB
testcase_06 AC 130 ms
41,888 KB
testcase_07 AC 115 ms
40,148 KB
testcase_08 AC 129 ms
41,532 KB
testcase_09 AC 129 ms
41,036 KB
testcase_10 AC 128 ms
41,464 KB
testcase_11 AC 126 ms
41,420 KB
testcase_12 WA -
testcase_13 AC 128 ms
41,288 KB
testcase_14 WA -
testcase_15 AC 129 ms
41,580 KB
testcase_16 AC 126 ms
41,364 KB
testcase_17 AC 129 ms
41,340 KB
testcase_18 AC 128 ms
41,108 KB
testcase_19 AC 114 ms
40,164 KB
testcase_20 AC 128 ms
41,584 KB
testcase_21 AC 127 ms
41,076 KB
testcase_22 AC 128 ms
41,192 KB
testcase_23 AC 127 ms
41,396 KB
testcase_24 AC 129 ms
41,444 KB
testcase_25 AC 128 ms
41,384 KB
testcase_26 AC 127 ms
41,292 KB
testcase_27 AC 127 ms
41,444 KB
testcase_28 AC 113 ms
39,856 KB
testcase_29 WA -
testcase_30 AC 130 ms
41,204 KB
testcase_31 WA -
testcase_32 AC 129 ms
41,468 KB
testcase_33 WA -
testcase_34 AC 128 ms
41,212 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a0 = sc.next();
		String a1 = sc.next();
		String[] s1 = a0.split("\\.");
		String[] s2 = a1.split("\\.");
		String ans = "";
		for(int i = 0 ; i < s1.length ; i++) {
			if(s1[i].compareTo(s2[i]) > 0) {
				ans = "YES";
				break;
			} else if(s1[i].compareTo(s2[i]) < 0){
				ans = "NO";
				break;
			} else if(s1[i].compareTo(s2[i]) == 0 && i == 2) {
				ans = "YES";
			}
		}
		System.out.println(ans);
 	}
}

0