結果

問題 No.722 100×100=1000
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2018-08-03 23:08:55
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 653 bytes
コンパイル時間 5,588 ms
コンパイル使用メモリ 73,244 KB
実行使用メモリ 58,280 KB
最終ジャッジ日時 2023-08-02 15:00:18
合計ジャッジ時間 11,375 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
56,188 KB
testcase_01 AC 126 ms
55,652 KB
testcase_02 AC 127 ms
55,732 KB
testcase_03 AC 126 ms
55,776 KB
testcase_04 AC 126 ms
55,664 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 120 ms
55,696 KB
testcase_08 AC 123 ms
58,280 KB
testcase_09 AC 127 ms
55,668 KB
testcase_10 AC 124 ms
55,444 KB
testcase_11 AC 125 ms
55,624 KB
testcase_12 AC 124 ms
55,828 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package test;

import java.util.Scanner;

public class main {
	public static void main (String[]args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		solve(a,b);
	}

	static private void solve(long a, long b) {
		long ans = a * b;
		if(check(a) && check(b)) {
			System.out.println(ans/10);
		} else {
			if(ans >= -99999999 && ans <= 99999999) {
				System.out.println(ans);
			} else {
				System.out.println("E");
			}
		}
	}

	static private boolean check(long num) {
		while(num%10 == 0) {
			num /= 10;
		}
		num = Math.abs(num);
		if(num >= 1 && num <= 9) {
			return true;
		}
		return false;
	}
}
0