結果

問題 No.441 和か積
ユーザー hiragn
提出日時 2019-07-19 03:59:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 426 bytes
コンパイル時間 1,853 ms
コンパイル使用メモリ 166,424 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-25 23:49:12
合計ジャッジ時間 2,636 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

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

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