結果

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
    string a,b;
    int a0,b0;
    cin >> a >> b;
    a0=a.back()-'0';b0=b.back()-'0';
    if(a.size()!=1&&b.size()!=1) cout << 'P' << endl;
    else if(a.size()!=1&&b.size()==1){
        if(b0>1) cout << 'P' << endl;
        else cout << 'S' << endl;
    }
    else if(a.size()==1&&b.size()!=1){
        if(a0>1) cout << 'P' << endl;
        else cout << 'S' << endl;
    }else{
        if(a0==2&&b0==2) cout << 'E' << endl;
        else if(a0>1&&b0>1) cout << 'P' << endl;
        else cout << 'S' << endl;
    }

    return 0;
}
0