結果

問題 No.441 和か積
コンテスト
ユーザー startcpp
提出日時 2016-11-12 20:52:44
言語 C++11
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 309µs
コード長 591 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 290 ms
コンパイル使用メモリ 72,680 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-30 22:12:20
合計ジャッジ時間 1,862 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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