結果

問題 No.722 100×100=1000
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-09-21 00:29:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 811 bytes
コンパイル時間 2,440 ms
コンパイル使用メモリ 71,228 KB
実行使用メモリ 56,436 KB
最終ジャッジ日時 2023-08-28 15:54:50
合計ジャッジ時間 7,282 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,884 KB
testcase_01 AC 124 ms
56,204 KB
testcase_02 AC 123 ms
54,192 KB
testcase_03 AC 124 ms
56,184 KB
testcase_04 AC 125 ms
55,972 KB
testcase_05 AC 124 ms
56,128 KB
testcase_06 AC 126 ms
56,324 KB
testcase_07 AC 120 ms
55,924 KB
testcase_08 AC 124 ms
55,792 KB
testcase_09 AC 124 ms
56,436 KB
testcase_10 AC 124 ms
55,632 KB
testcase_11 AC 124 ms
56,124 KB
testcase_12 AC 125 ms
55,912 KB
testcase_13 AC 123 ms
55,832 KB
testcase_14 AC 124 ms
56,080 KB
testcase_15 AC 124 ms
56,216 KB
testcase_16 AC 123 ms
55,564 KB
testcase_17 AC 123 ms
55,980 KB
testcase_18 AC 122 ms
55,892 KB
testcase_19 AC 124 ms
55,884 KB
testcase_20 AC 125 ms
56,260 KB
testcase_21 AC 127 ms
56,068 KB
testcase_22 AC 126 ms
56,264 KB
testcase_23 AC 125 ms
55,676 KB
testcase_24 AC 126 ms
55,760 KB
testcase_25 AC 124 ms
55,772 KB
testcase_26 AC 127 ms
56,084 KB
testcase_27 AC 126 ms
55,896 KB
testcase_28 AC 125 ms
56,108 KB
testcase_29 AC 124 ms
56,048 KB
testcase_30 AC 119 ms
56,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long A = in.nextLong();
        long B = in.nextLong();

        int n = 0;
        int m = 0;

        long al = Math.abs(A);
        long bl = Math.abs(B);

        for(int i=0; al>=10; i++) {
            al /= 10;
            n++;
        }
        for(int i=0; bl>=10; i++) {
            bl /= 10;
            m++;
        }

        long ans = 0;
        if((n >= 2 && A % Math.pow(10,n) == 0) &&
           (m >= 2 && B % Math.pow(10,m) == 0)) {
            ans = A * B / 10;
        } else if(Math.abs(A*B) <= 99999999) {
            ans = A * B;
        } else {
            System.out.println("E");
            return;
        }

        System.out.println(ans);
    }
}
0