結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 WA -
testcase_03 WA -
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 AC 1 ms
4,372 KB
testcase_11 AC 2 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 AC 2 ms
4,372 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,372 KB
testcase_16 AC 2 ms
4,372 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,372 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,372 KB
testcase_22 WA -
testcase_23 AC 2 ms
4,372 KB
testcase_24 AC 2 ms
4,372 KB
testcase_25 AC 2 ms
4,372 KB
testcase_26 AC 2 ms
4,372 KB
testcase_27 AC 2 ms
4,372 KB
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&&b>=100){
    if(((a>0)&&a%((to_string(a).size()-1)*10)==0)|| ((a<0)&&a%((to_string(a).size()-2)*10)==0)&&(((b>0)&&b%((to_string(b).size()-1)*10)==0)|| ((b<0)&&b%((to_string(b).size()-2)*10)==0)
      )){
    cout<<a*b/10<<endl;
    }else if(a*b<-99999999||a*b>99999999){
      cout<<"E"<<endl;
    }else{
      cout<<a*b<<endl;
    }
  }else{
    cout<<a*b<<endl;
  }
}
0