結果

問題 No.138 化石のバージョン
ユーザー omc-test
提出日時 2016-08-03 15:01:20
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 463 bytes
コンパイル時間 2,343 ms
コンパイル使用メモリ 78,348 KB
実行使用メモリ 41,556 KB
最終ジャッジ日時 2024-12-29 14:03:55
合計ジャッジ時間 8,153 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int kaseki = getVersion(sc.next());
		int judge = getVersion(sc.next());
		sc.close();
		System.out.println(kaseki >= judge ? "YES" : "NO");
	}

	public static int getVersion(String version){
		String[] s = version.split("\\.");
		int no = 0;
		for(int i=0; i<3; i++){
			no = no * 101 + Integer.valueOf(s[i]);
		}
		return no;
	}
}
0