結果

問題 No.722 100×100=1000
ユーザー GrenacheGrenache
提出日時 2018-09-16 18:56:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,141 bytes
コンパイル時間 4,042 ms
コンパイル使用メモリ 78,636 KB
実行使用メモリ 42,004 KB
最終ジャッジ日時 2024-04-20 15:28:43
合計ジャッジ時間 8,607 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
41,332 KB
testcase_01 AC 115 ms
41,276 KB
testcase_02 AC 118 ms
41,520 KB
testcase_03 AC 119 ms
41,908 KB
testcase_04 AC 106 ms
41,532 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 111 ms
41,724 KB
testcase_08 AC 102 ms
41,716 KB
testcase_09 AC 105 ms
41,676 KB
testcase_10 AC 117 ms
41,496 KB
testcase_11 WA -
testcase_12 AC 103 ms
41,236 KB
testcase_13 AC 106 ms
41,572 KB
testcase_14 AC 119 ms
41,608 KB
testcase_15 AC 111 ms
41,852 KB
testcase_16 AC 113 ms
41,484 KB
testcase_17 AC 105 ms
41,584 KB
testcase_18 AC 108 ms
41,484 KB
testcase_19 AC 106 ms
41,816 KB
testcase_20 AC 109 ms
41,720 KB
testcase_21 WA -
testcase_22 AC 107 ms
42,004 KB
testcase_23 AC 108 ms
41,428 KB
testcase_24 WA -
testcase_25 AC 104 ms
41,340 KB
testcase_26 AC 105 ms
41,512 KB
testcase_27 AC 120 ms
41,484 KB
testcase_28 AC 119 ms
41,564 KB
testcase_29 AC 112 ms
41,676 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