結果
問題 | No.138 化石のバージョン |
ユーザー |
![]() |
提出日時 | 2015-12-19 09:10:08 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 60 ms / 5,000 ms |
コード長 | 695 bytes |
コンパイル時間 | 2,390 ms |
コンパイル使用メモリ | 74,316 KB |
実行使用メモリ | 37,196 KB |
最終ジャッジ日時 | 2024-12-29 13:42:01 |
合計ジャッジ時間 | 5,498 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import java.io.*;import java.util.*;class Main138 {public static boolean check (String[] line1, String[] line2) {int[] ver1 = new int[3];int[] ver2 = new int[3];for (int i = 0; i < ver1.length; i++) {ver1[i] = Integer.parseInt(line1[i]);ver2[i] = Integer.parseInt(line2[i]);int sub = ver1[i] - ver2[i];if (sub != 0) return sub > 0;}return true;}public static void main (String[] args) throws IOException {BufferedReader br =new BufferedReader(new InputStreamReader(System.in));String[] line1 = br.readLine().split("\\.");String[] line2 = br.readLine().split("\\.");System.out.println(check(line1, line2) ? "YES" : "NO");}}