結果
問題 | No.138 化石のバージョン |
ユーザー |
![]() |
提出日時 | 2015-03-10 19:00:34 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 60 ms / 5,000 ms |
コード長 | 1,151 bytes |
コンパイル時間 | 3,846 ms |
コンパイル使用メモリ | 78,032 KB |
実行使用メモリ | 37,364 KB |
最終ジャッジ日時 | 2024-12-29 13:08:00 |
合計ジャッジ時間 | 7,396 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
//No.138 化石のバージョン import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No138 { static final InputStream in = System.in; static final PrintWriter out = new PrintWriter(System.out,false); static void solve() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String a = br.readLine(); String b = br.readLine(); String[] v1 = a.split("\\."); String[] v2 = b.split("\\."); int dig = 1; int n1 = 0, n2 = 0; for (int i=2; i>=0; i--) { n1 += dig*Integer.parseInt(v1[i]); n2 += dig*Integer.parseInt(v2[i]); dig *= 1000; } out.println(n1 >= n2 ? "YES" : "NO"); } public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); in.close(); } static void trace(Object... o) { System.out.println(deepToString(o));} }