結果
| 問題 |
No.722 100×100=1000
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-16 08:09:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 765 bytes |
| コンパイル時間 | 6,706 ms |
| コンパイル使用メモリ | 279,956 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-29 19:48:39 |
| 合計ジャッジ時間 | 7,257 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
ソースコード
/**
@file 722.cpp
@title No.722 100×100=1000 - yukicoder
@url https://yukicoder.me/problems/no/722
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
int main() {
LL A, B;
cin >> A >> B;
LL err_limit = 99999999;
regex re("[1-9]0{2,}");
// cout << regex_match(to_string(A), re) << endl;
// cout << regex_match(to_string(B), re) << endl;
if (regex_match(to_string(abs(A)), re) == true && regex_match(to_string(abs(B)), re) == true) {
cout << A * B / 10 << "\n";
} else {
if (-1 * err_limit <= (A * B) && (A * B) <= err_limit) {
cout << A * B << "\n";
} else {
cout << "E\n";
}
}
return 0;
}