結果
問題 |
No.722 100×100=1000
|
ユーザー |
👑 |
提出日時 | 2019-04-14 18:06:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 773 bytes |
コンパイル時間 | 710 ms |
コンパイル使用メモリ | 72,264 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 19:44:03 |
合計ジャッジ時間 | 1,776 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
#include <cstdio> #include <cstdlib> #include <cstddef> #include <vector> #include <algorithm> #include <cmath> #include <string> #include <iostream> #include <iomanip> #define L64 long long #define ASDF (1000000007LL) #define MODADD(A, B) (A = (A + B) % ASDF) bool isYuki(L64 v) { v = std::abs(v); if(v < 100LL) return false; while(0 < v){ L64 rem = v % 10LL; if(rem != 0 && 10LL <= v){ return false; } v /= 10LL; } return true; } int main(void) { L64 a, b; std::cin >> a >> b; if(isYuki(a) && isYuki(b)){ std::cout << a * b / 10LL << std::endl; } else { L64 calc = a * b; if(99999999LL < std::abs(calc)){ std::cout << "E" << std::endl; } else { std::cout << calc << std::endl; } } return 0; }