結果

問題 No.722 100×100=1000
ユーザー magmag
提出日時 2020-07-06 04:40:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 630 bytes
コンパイル時間 2,088 ms
コンパイル使用メモリ 168,192 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-24 20:40:39
合計ジャッジ時間 2,807 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  ll a,b;cin>>a>>b;
  if((a<=-100||a>=100)&&(b<=-100||b>=100)){
    int cnt=0;
    if(a<0){
      a*=-1;
      cnt++;
    }
    if(b<0){
      b*=-1;
      cnt++;
    }
    if((a%(to_string(a).size()*10)==0)&&((b%((to_string(b).size())*10)==0))){
    cout<<(cnt==1?-a*b/10:a*b/10)<<endl;
    }else if(a*b>99999999){
      cout<<"E"<<endl;
    }else{
      cout<<a*b<<endl;
    }
  }else{
    cout<<a*b<<endl;
  }
}
0