結果

問題 No.441 和か積
ユーザー hotpepsi
提出日時 2016-11-15 01:36:19
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 465 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 59,976 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-27 03:34:59
合計ジャッジ時間 1,451 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(int argc, char *argv[]) {
	string A, B, ans;
	cin >> A >> B;
	if (A.length() > B.length()) {
		swap(A, B);
	}
	if (B.length() < 8) {
		int a = atoi(A.c_str());
		int b = atoi(B.c_str());
		ans = a + b == a * b ? "E" : (a + b > a * b ? "S" : "P");
	} else if (A == "0" || A == "1") {
		ans = "S";
	} else {
		ans = "P";
	}
	cout << ans << endl;
	return 0;
}
0