結果
問題 |
No.722 100×100=1000
|
ユーザー |
![]() |
提出日時 | 2018-11-14 22:30:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 647 bytes |
コンパイル時間 | 1,741 ms |
コンパイル使用メモリ | 166,572 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 19:40:16 |
合計ジャッジ時間 | 2,841 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long int A,B; int func() { int a=abs(A),b=abs(B); int acnt=0,bcnt=0; if(a==0||b==0)return 0; while(a%10==0){ a/=10; acnt++; } while(b%10==0){ b/=10; bcnt++; } if (a<10&&2<=acnt&&b<10&&2<=bcnt) { return 1; } return 0; } signed main() { std::cin >> A>>B; if(func()){ std::cout << A*B/10 << '\n'; }else{ int ans = A*B; if (abs(ans)>99999999) { std::cout << "E" << '\n'; }else{ std::cout << ans << '\n'; } } return 0; }