結果

問題 No.722 100×100=1000
ユーザー xueleixuelei
提出日時 2018-08-03 23:14:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 667 bytes
コンパイル時間 1,330 ms
コンパイル使用メモリ 160,344 KB
実行使用メモリ 8,448 KB
最終ジャッジ日時 2024-04-20 15:03:07
合計ジャッジ時間 5,630 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,448 KB
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 OLE -
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;
int main(){
  long long a,b;
  cin >>a>>b;
  string sa,sb;
  sa=to_string(abs(a));
  sb=to_string(abs(b));
  bool cal=true;
  for(int i=1;i<sa.size();++i){
    if(sa[i]!='0')cal=false;
  }
  for(int i=1;i<sb.size();++i){
    if(sb[i]!='0')cal=false;
  }
  if(cal){
    cout << sa.size()+sb.size()-3 << endl;
    if(a*b<0)cout << "-";
    cout << (sa[0]-'0')*(sb[0]-'0');
    for(int i=0;i<(sa.size()+sb.size()-3);++i){
      cout << "0";
    }
    cout << endl;
    return 0;
  }
  string s=to_string(abs(a*b));
  if(s.size()>8){
    cout << "E" << endl;
    return 0;
  }else{
    cout << a*b << endl;
  }
  return 0;
}
0