結果

問題 No.138 化石のバージョン
ユーザー tentententen
提出日時 2020-11-10 16:45:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 5,000 ms
コード長 707 bytes
コンパイル時間 1,947 ms
コンパイル使用メモリ 71,756 KB
実行使用メモリ 57,760 KB
最終ジャッジ日時 2023-09-29 23:39:59
合計ジャッジ時間 7,823 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
56,256 KB
testcase_01 AC 115 ms
55,400 KB
testcase_02 AC 116 ms
56,020 KB
testcase_03 AC 116 ms
56,352 KB
testcase_04 AC 116 ms
55,828 KB
testcase_05 AC 115 ms
55,860 KB
testcase_06 AC 115 ms
55,908 KB
testcase_07 AC 114 ms
55,692 KB
testcase_08 AC 111 ms
57,760 KB
testcase_09 AC 116 ms
56,180 KB
testcase_10 AC 115 ms
55,424 KB
testcase_11 AC 116 ms
56,404 KB
testcase_12 AC 114 ms
55,356 KB
testcase_13 AC 118 ms
56,092 KB
testcase_14 AC 116 ms
55,892 KB
testcase_15 AC 116 ms
56,160 KB
testcase_16 AC 114 ms
55,612 KB
testcase_17 AC 114 ms
55,700 KB
testcase_18 AC 114 ms
55,636 KB
testcase_19 AC 115 ms
55,864 KB
testcase_20 AC 115 ms
55,916 KB
testcase_21 AC 115 ms
55,708 KB
testcase_22 AC 112 ms
56,060 KB
testcase_23 AC 113 ms
54,140 KB
testcase_24 AC 117 ms
55,688 KB
testcase_25 AC 112 ms
55,816 KB
testcase_26 AC 113 ms
56,276 KB
testcase_27 AC 118 ms
55,572 KB
testcase_28 AC 114 ms
55,836 KB
testcase_29 AC 114 ms
55,820 KB
testcase_30 AC 114 ms
55,564 KB
testcase_31 AC 114 ms
55,828 KB
testcase_32 AC 115 ms
55,876 KB
testcase_33 AC 116 ms
55,980 KB
testcase_34 AC 116 ms
55,736 KB
testcase_35 AC 115 ms
55,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        if (getNum(sc.next()) >= getNum(sc.next())) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
    
    static long getNum(String s) {
        long ans = 0;
        int prev = 0;
        for (char c : s.toCharArray()) {
            if (c == '.') {
                ans *= 1000;
                ans += prev;
                prev = 0;
            } else {
                prev *= 10;
                prev += c - '0';
            }
        }
        ans *= 1000;
        ans += prev;
        return ans;
    }
}
0