結果
| 問題 |
No.722 100×100=1000
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-10 18:07:59 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 771 bytes |
| コンパイル時間 | 1,411 ms |
| コンパイル使用メモリ | 88,384 KB |
| 最終ジャッジ日時 | 2025-01-09 15:43:21 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
ソースコード
#include <iostream>
#include <cmath>
#include <set>
using lint = long long;
void solve() {
std::set<lint> tens;
{
lint ten = 100;
for (int i = 0; i < 10; ++i) {
for (int d = -9; d <= 9; ++d) {
tens.insert(ten * d);
}
ten *= 10;
}
tens.erase(0);
}
lint a, b;
std::cin >> a >> b;
if (tens.count(a) && tens.count(b)) {
std::cout << a * b / 10 << std::endl;
return;
}
auto ans = a * b;
if (std::abs(ans) >= 100000000LL) {
std::cout << "E";
} else {
std::cout << ans;
}
std::cout << std::endl;
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}