結果
| 問題 | No.441 和か積 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-11-19 16:02:41 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 786 bytes | 
| コンパイル時間 | 1,352 ms | 
| コンパイル使用メモリ | 161,460 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-27 03:37:09 | 
| 合計ジャッジ時間 | 2,381 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 30 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
signed main(){
  string a, b; cin >> a >> b;
  if( not ( a.size() <= b.size() ) )
    swap( a, b );
  if( a.size() == b.size() and not ( a < b ) )
    swap( a, b );
  if( a.size() > 8 )
    cout << "P" << endl,
    exit( 0 );
  int x; stringstream ss( a ); ss >> x;
  if( x == 2 ){
    int y = 1e9;
    if( b.size() <= 8 ){
      stringstream sss( b ); sss >> y;
    }
    if( y == 2 )
      cout << "E" << endl;
    else
      cout << "P" << endl;
  } else if( x == 1 ){
    cout << "S" << endl;
  } else if( x == 0 ){
    int y = 1e9;
    if( b.size() <= 8 ){
      stringstream sss( b ); sss >> y;
    }
    if( y == 0 )
      cout << "E" << endl;
    else
      cout << "S" << endl;
  } else{
    cout << "P" << endl;
  }
  return 0;
}
            
            
            
        