結果
問題 | No.138 化石のバージョン |
ユーザー |
|
提出日時 | 2017-04-24 18:25:45 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 143 ms / 5,000 ms |
コード長 | 1,071 bytes |
コンパイル時間 | 3,735 ms |
コンパイル使用メモリ | 76,996 KB |
実行使用メモリ | 41,268 KB |
最終ジャッジ日時 | 2024-12-29 14:20:47 |
合計ジャッジ時間 | 9,628 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); int Amj = Integer.parseInt(A.split("\\.")[0]); int Amm = Integer.parseInt(A.split("\\.")[1]); int Ami = Integer.parseInt(A.split("\\.")[2]); String B = sc.next(); int Bmj = Integer.parseInt(B.split("\\.")[0]); int Bmm = Integer.parseInt(B.split("\\.")[1]); int Bmi = Integer.parseInt(B.split("\\.")[2]); if (Amj > Bmj) { System.out.println("YES"); } else if (Amj < Bmj) { System.out.println("NO"); } else { if (Amm > Bmm) { System.out.println("YES"); } else if (Amm < Bmm) { System.out.println("NO"); } else { if (Ami >= Bmi) { System.out.println("YES"); } else if (Ami < Bmi) { System.out.println("NO"); } } } } }