結果

問題 No.138 化石のバージョン
ユーザー tentententen
提出日時 2020-11-10 16:43:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 665 bytes
コンパイル時間 2,011 ms
コンパイル使用メモリ 71,912 KB
実行使用メモリ 56,092 KB
最終ジャッジ日時 2023-09-29 23:39:50
合計ジャッジ時間 7,344 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
53,540 KB
testcase_01 AC 99 ms
55,900 KB
testcase_02 AC 103 ms
55,556 KB
testcase_03 AC 99 ms
55,700 KB
testcase_04 AC 101 ms
56,092 KB
testcase_05 AC 101 ms
55,828 KB
testcase_06 AC 100 ms
55,840 KB
testcase_07 AC 103 ms
55,620 KB
testcase_08 AC 104 ms
55,920 KB
testcase_09 AC 104 ms
55,936 KB
testcase_10 AC 103 ms
55,584 KB
testcase_11 AC 106 ms
55,884 KB
testcase_12 AC 102 ms
55,628 KB
testcase_13 AC 103 ms
55,752 KB
testcase_14 AC 106 ms
55,640 KB
testcase_15 AC 110 ms
55,384 KB
testcase_16 AC 104 ms
55,968 KB
testcase_17 AC 105 ms
55,656 KB
testcase_18 AC 108 ms
55,568 KB
testcase_19 AC 106 ms
55,700 KB
testcase_20 WA -
testcase_21 AC 103 ms
55,876 KB
testcase_22 AC 106 ms
55,580 KB
testcase_23 AC 109 ms
55,784 KB
testcase_24 AC 106 ms
55,572 KB
testcase_25 AC 107 ms
55,808 KB
testcase_26 AC 103 ms
55,972 KB
testcase_27 AC 101 ms
55,556 KB
testcase_28 AC 102 ms
55,616 KB
testcase_29 AC 107 ms
55,952 KB
testcase_30 AC 100 ms
56,020 KB
testcase_31 AC 102 ms
55,972 KB
testcase_32 AC 103 ms
56,020 KB
testcase_33 AC 100 ms
55,632 KB
testcase_34 AC 103 ms
55,344 KB
testcase_35 AC 101 ms
56,004 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';
            }
        }
        return ans;
    }
}
0