結果

問題 No.722 100×100=1000
ユーザー xuelei
提出日時 2018-08-03 23:16:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 624 bytes
コンパイル時間 1,558 ms
コンパイル使用メモリ 161,784 KB
実行使用メモリ 13,636 KB
最終ジャッジ日時 2024-10-12 10:44:13
合計ジャッジ時間 5,795 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 WA * 2 OLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

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){
    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