結果

問題 No.138 化石のバージョン
ユーザー YukimotoPG
提出日時 2019-02-14 13:54:01
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 474 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 74,552 KB
実行使用メモリ 54,232 KB
最終ジャッジ日時 2024-09-13 11:22:20
合計ジャッジ時間 7,663 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		String[] a = sc.next().split("\\.",0);
		String[] b = sc.next().split("\\.",0);
		String ans = "YES";
		
		
		for (int i=0; i<3; i++) {
			int t1 = Integer.parseInt(b[i]);
			int t2 = Integer.parseInt(a[i]);
			
			if (t1 < t2) {
				ans = "YES"; break;
			}
			else if (t1 > t2) {
				ans = "NO"; break;
			}
		}
		System.out.println(ans);
		
	}
}
0