結果
| 問題 |
No.722 100×100=1000
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-22 15:37:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 624 bytes |
| コンパイル時間 | 620 ms |
| コンパイル使用メモリ | 69,256 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 11:10:30 |
| 合計ジャッジ時間 | 1,609 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 WA * 8 |
ソースコード
#include<iostream>
#include<string>
#include<math.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
string astr = to_string(A);
string bstr = to_string(B);
if (A%100==0 && B%100==0 ) {
int size = 0;
if (A<0 || B<0) size = astr.size() + bstr.size() - 3;
else size = astr.size() + bstr.size() - 2;
while (A>=10 || A<=-10) {
A /= 10;
}
while (B>=10 || B<=-10) {
B /= 10;
}
int ans = A * B;
cout << ans;
for (int i = 0;i < size-1;i++) {
cout << 0;
}
return 0;
}
else {
if (astr.size()+bstr.size() > 8)cout << 'E' << endl;
else cout << A * B << endl;;
}
return 0;
}