結果
| 問題 |
No.722 100×100=1000
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-10-30 18:07:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,811 bytes |
| コンパイル時間 | 1,674 ms |
| コンパイル使用メモリ | 194,424 KB |
| 最終ジャッジ日時 | 2025-01-06 15:10:15 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
template <typename T>
class Array : public vector<T> {
public:
using vector<T>::vector;
using vector<T>::begin;
using vector<T>::end;
using vector<T>::push_back;
template <typename R>
Array<R> map(function<R(T)> f) {
Array<R> res(end() - begin());
for (auto it = begin(); it != end(); ++it) res[it - begin()] = f(*it);
return res;
}
Array<T> select(function<bool(T)> f) {
Array<T> res;
for (auto it = begin(); it != end(); ++it)
if (f(*it)) res.push_back(*it);
return res;
}
template <typename R>
R reduce(R u, function<R(R, T)> f) {
for (auto it = begin(); it != end(); ++it) u = f(u, *it);
return u;
}
template <typename U>
Array<pair<T, U>> zip(const Array<U> &b) {
assert(end() - begin() == b.end() - b.begin());
Array<pair<T, U>> res;
for (auto it = begin(); it != end(); ++it)
res.push_back({*it, b[it - begin()]});
return res;
}
Array<T> iota(T st) {
Array<T> res(end() - begin());
::iota(res.begin(), res.end(), st);
return res;
}
Array<T> slice(int st, size_t len) {
auto it = (st < 0 ? end() : begin()) + st;
return Array<T>(it, it + len);
}
void inspect() {
if (begin() == end()) return void(cout << endl);
copy(begin(), prev(end()), ostream_iterator<T>(cout, ", "));
cout << *prev(end()) << endl;
}
};
signed main() {
ios::sync_with_stdio(false);
int A, B;
cin >> A >> B;
auto is_easy = [](int x) {
if (x % 100 || x == 0) return false;
while (x % 10 == 0) x /= 10;
return x < 10;
};
if (is_easy(A) && is_easy(B)) {
cout << 1LL * A * B / 10 << endl;
} else {
int64_t res = 1LL * A * B;
if (abs(res) < 1e8) cout << res << endl;
else cout << "E" << endl;
}
return 0;
}