結果

問題 No.722 100×100=1000
ユーザー GrenacheGrenache
提出日時 2018-09-16 18:58:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,161 bytes
コンパイル時間 3,187 ms
コンパイル使用メモリ 78,432 KB
実行使用メモリ 54,444 KB
最終ジャッジ日時 2024-04-20 15:29:11
合計ジャッジ時間 7,538 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
54,444 KB
testcase_01 AC 117 ms
54,248 KB
testcase_02 AC 116 ms
54,184 KB
testcase_03 AC 107 ms
52,992 KB
testcase_04 AC 113 ms
54,028 KB
testcase_05 AC 105 ms
53,172 KB
testcase_06 AC 116 ms
54,328 KB
testcase_07 AC 126 ms
54,328 KB
testcase_08 AC 115 ms
54,324 KB
testcase_09 AC 105 ms
53,120 KB
testcase_10 AC 109 ms
53,432 KB
testcase_11 WA -
testcase_12 AC 117 ms
54,168 KB
testcase_13 AC 116 ms
54,376 KB
testcase_14 AC 108 ms
52,968 KB
testcase_15 AC 116 ms
53,888 KB
testcase_16 AC 104 ms
53,284 KB
testcase_17 AC 113 ms
54,056 KB
testcase_18 AC 100 ms
52,780 KB
testcase_19 AC 113 ms
54,096 KB
testcase_20 AC 104 ms
53,200 KB
testcase_21 AC 117 ms
54,316 KB
testcase_22 AC 104 ms
53,116 KB
testcase_23 AC 115 ms
54,276 KB
testcase_24 AC 110 ms
53,096 KB
testcase_25 AC 116 ms
54,424 KB
testcase_26 AC 106 ms
53,180 KB
testcase_27 AC 105 ms
53,152 KB
testcase_28 AC 104 ms
53,092 KB
testcase_29 AC 107 ms
53,172 KB
testcase_30 AC 105 ms
53,284 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