結果
問題 |
No.722 100×100=1000
|
ユーザー |
|
提出日時 | 2018-09-30 10:51:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 704 bytes |
コンパイル時間 | 702 ms |
コンパイル使用メモリ | 69,200 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 19:38:33 |
合計ジャッジ時間 | 1,912 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; int d(int x){ int D = 10000000; for(; 1 != D && 0 != (x % D); D /= 10){} return D; } int main(void){ int A, B; cin >> A >> B; int DA = d(A); int a = A / DA; int DB = d(B); int b = B / DB; long long LLA = (long long)a; long long LLB = (long long)b; long long LLDA = (long long)DA; long long LLDB = (long long)DB; long long product = LLA * LLB * LLDA * LLDB; if(abs(a) < 10 && abs(b) < 10 && DA >= 100 && DB >= 100){ cout << product / 10 << endl; return 0; } if(100000000 <= abs(product)){ cout << 'E' << endl; return 0; } cout << product << endl; return 0; }