結果
問題 |
No.722 100×100=1000
|
ユーザー |
![]() |
提出日時 | 2018-11-29 14:19:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,144 bytes |
コンパイル時間 | 1,228 ms |
コンパイル使用メモリ | 109,648 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 19:41:02 |
合計ジャッジ時間 | 2,085 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include <queue> #include <iomanip> #include <array> #include <numeric> #include <regex> #include <bitset> #include <deque> using namespace std; typedef long long ll; typedef pair<int, int> p_ii; const int INF = 1e9; const double PI = acos(-1.0); const ll MOD = 1e9 + 7; ll dig(ll x){ x=abs(x); int d = 0; while(x!=0){ d++; x/=10; } ll ret = 1; for (int i = 0; i < d-1; i++) { ret*=10; } return ret; } int main() { ll A, B; cin>>A>>B; ll diA= dig(A), diB= dig(B); if(A!=0 && B!=0 && abs(A)%diA==0 && abs(B)%diB==0&& diA>=100&& diB>=100){ cout<<A*B/10<<endl; } else{ ll res=A*B; if(res<-99999999 || res>99999999){ cout<<'E'<<endl; }else{ cout<<A*B<<endl; } } return 0; }