結果

問題 No.722 100×100=1000
ユーザー sggkshio
提出日時 2018-11-28 01:19:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 947 bytes
コンパイル時間 1,862 ms
コンパイル使用メモリ 81,632 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 19:40:55
合計ジャッジ時間 1,746 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>
using namespace std;

//#include<bits/stdc++.h>

int main() {
	
	long long int a, b;
	cin >> a >> b;
	long long int x = a, y = b;
	bool fa = 0, fb = 0;
	int r = 0;
	while (abs(x) >= 10) {
		if (x % 10)fa = 1;
		x /= 10;
		r++;
	}
	//if (!fa&&abs(a) < 100)r++;
	while (abs(y) >= 10) {
		if (y % 10)fb = 1;
		y /= 10;
		r++;
	}
	if ((!fb&&abs(b) < 100)|| (!fa&&abs(a) < 100))r++;
	
	if (!fa && !fb) {
		cout << x*y;
		if (x*y) {
			for (int i = 0; i < r - 1; i++) {
				cout << "0";
			}
		}
		cout << endl;
	}
	else {
		if (abs(a*b) >= 100000000)cout << 'E' << endl;
		else cout << a*b<<endl;
	}




	return 0;
}
0