結果
問題 | No.138 化石のバージョン |
ユーザー |
![]() |
提出日時 | 2015-12-12 16:06:35 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 58 ms / 5,000 ms |
コード長 | 706 bytes |
コンパイル時間 | 2,555 ms |
コンパイル使用メモリ | 73,564 KB |
実行使用メモリ | 37,320 KB |
最終ジャッジ日時 | 2024-12-29 13:40:22 |
合計ジャッジ時間 | 5,279 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); try { String[] fir = read.readLine().split("\\."); String[] sec = read.readLine().split("\\."); boolean flag = false; for (int i = 0; i < 3; ++i) { if (Integer.parseInt(fir[i]) < Integer.parseInt(sec[i])) { flag = true; break; }else if(Integer.parseInt(fir[i]) > Integer.parseInt(sec[i])){ break; } } if (flag) { System.out.println("NO"); } else { System.out.println("YES"); } } catch (Exception e) { e.printStackTrace(); } } }