結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int f(string s) {
    int y = (s.size() > 1) ? 3 : s[s.length() - 1] - '0';
    return y;
}

int main() {
    string a, b;
    cin >> a >> b;
    int aa = f(a), bb = f(b);

    if ((aa - 1) * (bb - 1) > 1) {
        cout << "P" << endl;
    } else if ((aa - 1) * (bb - 1) < 1) {
        cout << "S" << endl;
    } else {
        cout << "E" << endl;
    }
    return 0;
}
0