結果
問題 | No.138 化石のバージョン |
ユーザー |
![]() |
提出日時 | 2015-04-09 11:22:49 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 140 ms / 5,000 ms |
コード長 | 869 bytes |
コンパイル時間 | 2,521 ms |
コンパイル使用メモリ | 76,960 KB |
実行使用メモリ | 41,488 KB |
最終ジャッジ日時 | 2024-12-29 13:10:28 |
合計ジャッジ時間 | 8,438 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import java.util.*;public class Main {public static void main(String[] args) throws Exception {Scanner koko = new Scanner(System.in);String a = koko.next();String b = koko.next();String[] ah = a.split("\\.");String[] bh = b.split("\\.");int[] c = new int[6];for(int i=0; i<3; i++){c[i] = Integer.parseInt(ah[i]);c[i+3] = Integer.parseInt(bh[i]);}if(c[3]>c[0]){System.out.println("NO");}else if(c[3]<c[0]){System.out.println("YES");}else if(c[4]>c[1]){System.out.println("NO");}else if(c[4]<c[1]){System.out.println("YES");}else if(c[5]>c[2]){System.out.println("NO");}else if(c[5]<=c[2]){System.out.println("YES");}}}