結果

問題 No.722 100×100=1000
ユーザー tomato
提出日時 2018-08-03 22:51:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 567 ms
コンパイル使用メモリ 59,352 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 19:21:11
合計ジャッジ時間 1,676 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

bool ansan(int n) {
  n = abs(n);
  if (n < 100) return false;
  while (n % 10 == 0) {
    n /= 10;
  }
  return n < 10;
}

int main() {
  long long a, b;
  cin >> a >> b;
  if (ansan(a) && ansan(b)) {
    cout << a * b / 10 << endl;
  } else {
    long long ans = a * b;
    if (-99999999 <= ans && ans <= 99999999) {
      cout << ans << endl;
    } else {
      cout << "E" << endl;
    }
  }
}
0