結果
| 問題 | 
                            No.441 和か積
                             | 
                    
| コンテスト | |
| ユーザー | 
                             nenuon
                         | 
                    
| 提出日時 | 2018-01-22 23:57:13 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3 ms / 1,000 ms | 
| コード長 | 1,070 bytes | 
| コンパイル時間 | 710 ms | 
| コンパイル使用メモリ | 89,932 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-27 03:57:11 | 
| 合計ジャッジ時間 | 1,615 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 30 | 
ソースコード
#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 {
    cout << "P" << endl;
  }
  }
  else if(len_b == 1){
    if(B[0] == '0' || B[0] == '1'){
      cout << "S" << endl;
    }
else {
    cout << "P" << endl;
  }
  }
  else {
    cout << "P" << endl;
  }
  return 0;
}
            
            
            
        
            
nenuon