結果
問題 |
No.722 100×100=1000
|
ユーザー |
|
提出日時 | 2018-09-16 18:58:00 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,161 bytes |
コンパイル時間 | 3,732 ms |
コンパイル使用メモリ | 78,372 KB |
実行使用メモリ | 54,252 KB |
最終ジャッジ日時 | 2024-10-12 11:09:10 |
合計ジャッジ時間 | 8,851 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 WA * 1 |
ソースコード
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); } } }