結果

問題 No.138 化石のバージョン
ユーザー maru
提出日時 2016-03-23 12:18:48
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 1,029 bytes
コンパイル時間 4,151 ms
コンパイル使用メモリ 77,624 KB
実行使用メモリ 41,480 KB
最終ジャッジ日時 2024-12-29 13:53:27
合計ジャッジ時間 9,900 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

		String[] a_str = a.split("\\.");
		String[] b_str = b.split("\\.");
		
		int[] a_number = new int[a_str.length];
		int[] b_number = new int[b_str.length];
		
		
		for (int i = 0; i < a_str.length; i++) {
			a_number[i] = Integer.parseInt(a_str[i]);
			b_number[i] = Integer.parseInt(b_str[i]);
		}
		
		if (a_number[0] > b_number[0]) {
			System.out.println("YES");
		} else if (a_number[0] == b_number[0]) {
			if (a_number[1] > b_number[1]) {
				System.out.println("YES");
			} else if (a_number[1] == b_number[1]) {
				if (a_number[2] > b_number[2]) {
					System.out.println("YES");
				} else if (a_number[2] == b_number[2]){
					System.out.println("YES");
				} else {
					System.out.println("NO");
				}
				
				
			} else {
				System.out.println("NO");
			}
		} else {
			System.out.println("NO");
		}
	}
}
0