結果

問題 No.722 100×100=1000
ユーザー DeAKetsuDeAKetsu
提出日時 2019-06-03 12:37:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 811 bytes
コンパイル時間 1,820 ms
コンパイル使用メモリ 71,428 KB
実行使用メモリ 57,524 KB
最終ジャッジ日時 2023-08-28 15:57:39
合計ジャッジ時間 6,659 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,908 KB
testcase_01 AC 117 ms
56,760 KB
testcase_02 AC 117 ms
55,940 KB
testcase_03 AC 116 ms
56,248 KB
testcase_04 AC 117 ms
56,424 KB
testcase_05 AC 118 ms
55,812 KB
testcase_06 AC 118 ms
56,276 KB
testcase_07 AC 116 ms
55,756 KB
testcase_08 AC 117 ms
56,332 KB
testcase_09 AC 118 ms
55,804 KB
testcase_10 AC 117 ms
55,896 KB
testcase_11 AC 118 ms
56,108 KB
testcase_12 AC 117 ms
56,260 KB
testcase_13 AC 118 ms
56,120 KB
testcase_14 AC 117 ms
56,224 KB
testcase_15 AC 117 ms
56,088 KB
testcase_16 AC 117 ms
56,316 KB
testcase_17 AC 118 ms
56,080 KB
testcase_18 AC 117 ms
56,092 KB
testcase_19 AC 116 ms
56,372 KB
testcase_20 AC 117 ms
56,640 KB
testcase_21 AC 117 ms
55,832 KB
testcase_22 AC 116 ms
56,336 KB
testcase_23 AC 117 ms
56,320 KB
testcase_24 AC 117 ms
56,248 KB
testcase_25 AC 121 ms
57,524 KB
testcase_26 AC 116 ms
55,920 KB
testcase_27 AC 116 ms
56,036 KB
testcase_28 AC 116 ms
56,208 KB
testcase_29 AC 116 ms
56,040 KB
testcase_30 AC 117 ms
55,960 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