結果

問題 No.138 化石のバージョン
ユーザー YamaKasa
提出日時 2018-04-25 23:29:12
言語 Java
(openjdk 23)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 572 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 74,276 KB
実行使用メモリ 41,756 KB
最終ジャッジ日時 2024-06-27 21:06:39
合計ジャッジ時間 8,444 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s1 = scan.next();
		String s2 = scan.next();
		scan.close();
		String []str1 = s1.split("[.]");
		String []str2 = s2.split("[.]");

		for(int i = 0; i < str1.length; i++) {
			int k1 = Integer.parseInt(str1[i]);
			int k2 = Integer.parseInt(str2[i]);
			if(k1 > k2) {
				System.out.println("YES");
				System.exit(0);
			}else if(k1 < k2){
				System.out.println("NO");
				System.exit(0);
			}
		}
		System.out.println("YES");
	}
}
0