結果

問題 No.722 100×100=1000
ユーザー どららどらら
提出日時 2018-08-04 11:33:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 715 bytes
コンパイル時間 1,573 ms
コンパイル使用メモリ 162,592 KB
実行使用メモリ 13,888 KB
最終ジャッジ日時 2024-04-20 15:06:08
合計ジャッジ時間 5,221 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,144 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
6,944 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  ll A, B;
  cin >> A >> B;

  if(A % 100 == 0 && B % 100 == 0){
    int n = 0, m = 0;
    while(A % 10 == 0){ n++; A/=10; }
    while(B % 10 == 0){ m++; B/=10; }

    cout << A*B;
    rep(i,n+m-1) cout << "0";
    cout << endl;
  }else{
    ll ret = A * B;
    if(ret <= -100000000LL || 100000000LL <= ret){
      cout << "E" << endl;
    }else{
      cout << ret << endl;
    }
  }
  
  return 0;
}
0