結果

問題 No.441 和か積
ユーザー aitdccdaitdccd
提出日時 2017-11-29 07:27:18
言語 C++11
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 428 bytes
コンパイル時間 1,583 ms
コンパイル使用メモリ 158,676 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 00:54:54
合計ジャッジ時間 3,107 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int f(string s) {
    int y = (s.size() > 1) ? s.length() : 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