結果

問題 No.441 和か積
ユーザー tnakao0123
提出日時 2016-11-20 23:54:23
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 821 bytes
コンパイル時間 791 ms
コンパイル使用メモリ 85,288 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 03:37:14
合計ジャッジ時間 1,727 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 441.cc: No.441 和か積 - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  string sa, sb;
  cin >> sa >> sb;

  int a = (sa.size() == 1) ? sa[0] - '0' : 10;
  int b = (sb.size() == 1) ? sb[0] - '0' : 10;
  int p = a * b, s = a + b;
  //printf("a=%d, b=%d\n", a, b);
  //printf("a*b=%d, a+b=%d\n", p, s);

  char ch = (p > s) ? 'P' : (p < s) ? 'S' : 'E';
  printf("%c\n", ch);
  return 0;
}
0