結果

問題 No.722 100×100=1000
ユーザー GrenacheGrenache
提出日時 2018-09-16 18:58:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,161 bytes
コンパイル時間 3,879 ms
コンパイル使用メモリ 75,344 KB
実行使用メモリ 57,768 KB
最終ジャッジ日時 2023-08-02 15:23:15
合計ジャッジ時間 8,763 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,816 KB
testcase_01 AC 123 ms
55,668 KB
testcase_02 AC 121 ms
55,396 KB
testcase_03 AC 123 ms
55,396 KB
testcase_04 AC 124 ms
55,712 KB
testcase_05 AC 124 ms
55,640 KB
testcase_06 AC 122 ms
55,400 KB
testcase_07 AC 124 ms
55,484 KB
testcase_08 AC 122 ms
55,956 KB
testcase_09 AC 123 ms
56,328 KB
testcase_10 AC 123 ms
55,896 KB
testcase_11 WA -
testcase_12 AC 123 ms
55,848 KB
testcase_13 AC 127 ms
55,676 KB
testcase_14 AC 123 ms
55,584 KB
testcase_15 AC 123 ms
55,684 KB
testcase_16 AC 124 ms
56,020 KB
testcase_17 AC 124 ms
55,608 KB
testcase_18 AC 123 ms
55,732 KB
testcase_19 AC 125 ms
55,716 KB
testcase_20 AC 124 ms
55,352 KB
testcase_21 AC 124 ms
55,676 KB
testcase_22 AC 124 ms
55,380 KB
testcase_23 AC 128 ms
55,600 KB
testcase_24 AC 124 ms
55,856 KB
testcase_25 AC 123 ms
55,612 KB
testcase_26 AC 122 ms
55,652 KB
testcase_27 AC 123 ms
55,668 KB
testcase_28 AC 123 ms
55,648 KB
testcase_29 AC 125 ms
55,632 KB
testcase_30 AC 124 ms
55,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder722 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		long a = sc.nextInt();
		long b = sc.nextInt();
		
		if (a == 0 || b == 0) {
			pr.println(0);
			return;
		}

		int n = 0;
		long tmpa = a;
		while (tmpa % 10 == 0) {
			n++;
			tmpa /= 10;
		}
		int m = 0;
		long tmpb = b;
		while (tmpb % 10 == 0) {
			m++;
			tmpb /= 10;
		}
		
		if (tmpa < 10 && tmpb < 10 && n >= 2 && m >= 2) {
			pr.print(tmpa * tmpb);
			for (int i = 0; i < n + m - 1; i++) {
				pr.print('0');
			}
			pr.println();
		} else {
			if (a * b < 100_000_000 && a * b > -100_000_000) {
				pr.println(a * b);
			} else {
				pr.println('E');
			}
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0