結果

問題 No.722 100×100=1000
ユーザー hatsuka_iwa
提出日時 2021-02-20 03:35:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 539 bytes
コンパイル時間 1,706 ms
コンパイル使用メモリ 167,380 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-17 06:24:57
合計ジャッジ時間 2,511 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 20 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

bool check(string S) {
  int zero = 0;

  for (char C : S) {
    if (C == '0')
      zero++;
  }

  return zero == (int)S.size() - 1 ? true : false;
}

void calc(int64_t A, int64_t B, bool M) {
  if (M) {
    cout << A * B / 10 << endl;
  }
  else {
    if (A * B >= -99999999 && A * B <= 99999999)
      cout << A * B << endl;
    else
      cout << 'E' << endl;
  }
}

int main() {
  int64_t A, B;
  cin >> A >> B;
  calc(A, B, check(to_string(A)) == true && check(to_string(B)) == true);
}
0