結果

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

string a, b;

int main() {
	cin >> a >> b;
	
	if (a.length() >= 2 && b.length() >= 2) { cout << "P" << endl; return 0; }
	if (a.length() > b.length() || (a.length() == b.length() && a[0] > b[0])) swap(a, b);
	
	if (a[0] >= '3') { cout << "P" << endl; return 0; }
	if (a[0] == '2') { cout << ((b.length() == 1 && b[0] == '2') ? "E" : "P") << endl; return 0; }
	if (a[0] == '1') { cout << "S" << endl; return 0; }
	if (a[0] == '0') { cout << ((b.length() == 1 && b[0] == '0') ? "E" : "S") << endl; }
	return 0;
}
0