結果
問題 |
No.441 和か積
|
ユーザー |
![]() |
提出日時 | 2017-07-01 15:03:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 998 bytes |
コンパイル時間 | 1,016 ms |
コンパイル使用メモリ | 88,500 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 00:54:48 |
合計ジャッジ時間 | 2,121 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 WA * 2 |
ソースコード
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++I) typedef long long ll; int main(){ string A, B; cin >> A >> B; int len_a = A.length(); int len_b = B.length(); if(len_a == 1 && len_b == 1){ if((A[0]-'0') + (B[0]-'0') > (A[0]-'0') * (B[0]-'0')){ cout << "S" << endl; } if((A[0]-'0') + (B[0]-'0') < (A[0]-'0') * (B[0]-'0')){ cout << "P" << endl; } if((A[0]-'0') + (B[0]-'0') == (A[0]-'0') * (B[0]-'0')){ cout << "E" << endl; } } else if(len_a == 1){ if(A[0] == '0' || A[0] == '1'){ cout << "S" << endl; } } else if(len_b == 1){ if(B[0] == '0' || B[0] == '1'){ cout << "S" << endl; } } else { cout << "P" << endl; } return 0; }