結果

問題 No.138 化石のバージョン
ユーザー shinwisteria
提出日時 2018-03-04 16:24:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 740 bytes
コンパイル時間 4,422 ms
コンパイル使用メモリ 77,520 KB
実行使用メモリ 41,444 KB
最終ジャッジ日時 2024-07-08 00:18:37
合計ジャッジ時間 8,438 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con138 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String[] verA = s.next().split("\\.",3);
		String[] verB = s.next().split("\\.",3);
		s.close();

		int[] A = new int[3] ,B = new int[3];
		for(int i = 0;i < 3;i++){
			A[i] = Integer.parseInt(verA[i]);
			B[i] = Integer.parseInt(verB[i]);
		}

		if(A[0] > B[0]){
			System.out.println("YES");
		}else if(A[0] == B[0]){
			if(A[1] > B[1]){
				System.out.println("YES");
			}else if(A[1] == B[1]){
				if(A[2] >= B[2]){
					System.out.println("YES");
				}else{
					System.out.println("NO");
				}
			}else{
				System.out.println("NO");
			}
		}else{
			System.out.println("NO");
		}
	}

}
0