結果

問題 No.722 100×100=1000
ユーザー GrenacheGrenache
提出日時 2018-09-16 18:56:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,141 bytes
コンパイル時間 3,399 ms
コンパイル使用メモリ 74,504 KB
実行使用メモリ 58,524 KB
最終ジャッジ日時 2023-08-02 15:22:50
合計ジャッジ時間 8,523 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,448 KB
testcase_01 AC 122 ms
56,168 KB
testcase_02 AC 122 ms
55,484 KB
testcase_03 AC 123 ms
56,080 KB
testcase_04 AC 122 ms
55,904 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 120 ms
53,900 KB
testcase_08 AC 121 ms
56,180 KB
testcase_09 AC 120 ms
56,040 KB
testcase_10 AC 122 ms
55,456 KB
testcase_11 WA -
testcase_12 AC 125 ms
55,716 KB
testcase_13 AC 124 ms
55,908 KB
testcase_14 AC 120 ms
55,688 KB
testcase_15 AC 122 ms
55,764 KB
testcase_16 AC 120 ms
56,332 KB
testcase_17 AC 121 ms
55,504 KB
testcase_18 AC 121 ms
55,988 KB
testcase_19 AC 122 ms
56,104 KB
testcase_20 AC 121 ms
55,764 KB
testcase_21 WA -
testcase_22 AC 122 ms
55,776 KB
testcase_23 AC 123 ms
58,144 KB
testcase_24 WA -
testcase_25 AC 123 ms
56,320 KB
testcase_26 AC 122 ms
56,180 KB
testcase_27 AC 124 ms
56,012 KB
testcase_28 AC 120 ms
55,484 KB
testcase_29 AC 121 ms
56,320 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

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) {
			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