結果

問題 No.722 100×100=1000
ユーザー rogi52
提出日時 2022-09-27 04:33:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 733 bytes
コンパイル時間 2,058 ms
コンパイル使用メモリ 193,724 KB
最終ジャッジ日時 2025-02-07 17:00:48
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    ll A,B; cin >> A >> B;
    auto f = [&](ll X) {
        string s = to_string(abs(X));
        if(s.size() <= 2u) return false;
        for(int i = 1; i < int(s.size()); i++) if(s[i] != '0') return false;
        return true;
    };

    ll C = A * B;
    if(f(A) && f(B)) {
        if(C % 10 == 0) {
            cout << C / 10 << endl;
        } else {
            cout << C << endl;
        }
    } else {
        if(-99999999 <= C && C <= +99999999) {
            cout << C << endl;
        } else {
            cout << "E" << endl;
        }
    }
}
0