結果

問題 No.722 100×100=1000
ユーザー NoiriNoiri
提出日時 2019-02-27 16:50:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 597 bytes
コンパイル時間 1,383 ms
コンパイル使用メモリ 164,932 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 16:16:39
合計ジャッジ時間 2,195 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(){
    ll a, b;
    cin >> a >> b;
    ll ans = 0;
    string s = to_string(abs(a));
    string t = to_string(abs(b));
    ll A = pow(10, s.size()-1);
    ll B = pow(10, t.size()-1);
    if(abs(a)%A  == 0 && abs(b)%B == 0){
        ans = a * b;
        if(abs(ans) % 10 == 0) cout << ans/10 << endl;
        else cout << ans << endl;
    }
    else{
        ans = a * b;
        string res = to_string(abs(ans));
        if(res.size() >= 9) cout << "E" << endl;
        else cout << ans << endl;
    }

    return 0;
}
0