結果
問題 | No.441 和か積 |
ユーザー |
![]() |
提出日時 | 2016-11-11 22:51:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,161 bytes |
コンパイル時間 | 656 ms |
コンパイル使用メモリ | 83,364 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-27 03:26:47 |
合計ジャッジ時間 | 1,556 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <iostream>#include <algorithm>#include <functional>#include <string>#include <climits>#include <vector>#include <numeric>#include <complex>#include <map>#include <bitset>#include <stack>#include <queue>#include <set>#include <stdlib.h>using namespace std;//#define __int64 long long#define REP(i,a,b) for(int i=a;i<b;i++)#define rep(i,n) REP(i,0,n)const int Vec = 4;const int Vecy[Vec] = {0,-1,0,1};const int Vecx[Vec] = {1,0,-1,0};const int Modd = 1000000007;int main(){string a,b;int mind;cin >> a >> b;if(a.length() >= 2 && b.length() >= 2){cout << "P" << endl;}else{if(a.length() == 1 && b.length() == 1){int a2 = atoi(a.c_str());int b2 = atoi(b.c_str());if(a2 + b2 < a2 * b2){cout << "P" << endl;}else if(a2 + b2 > a2 * b2){cout << "S" << endl;}else{cout << "E" << endl;}return 0;}else{if(a.length() == 1){if(a[0] == '0' || a[0] == '1'){cout << "S" << endl;return 0;}}if(b.length() == 1){if(b[0] == '0' || b[0] == '1'){cout << "S" << endl;return 0;}}cout << "P" << endl;}}return 0;}