結果

問題 No.441 和か積
コンテスト
ユーザー alpha_virginis
提出日時 2016-11-14 01:02:43
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 731 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,175 ms
コンパイル使用メモリ 178,880 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-14 08:00:00
合計ジャッジ時間 1,840 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

char xs[256];
char ys[256];

int main() {
  scanf("%s %s", xs, ys);

  bool xIsZero = strcmp(xs, "0") == 0 and strlen(xs) == 1;
  bool xIsOne  = strcmp(xs, "1") == 0 and strlen(xs) == 1;
  bool xIsTwo  = strcmp(xs, "2") == 0 and strlen(xs) == 1;
  bool yIsZero = strcmp(ys, "0") == 0 and strlen(ys) == 1;
  bool yIsOne  = strcmp(ys, "1") == 0 and strlen(ys) == 1;
  bool yIsTwo  = strcmp(ys, "2") == 0 and strlen(ys) == 1;

  if( xIsZero and yIsZero ) {
    puts("E"); return 0;
  }
  if( xIsZero or yIsZero ) {
    puts("S"); return 0;
  }
  if( xIsOne or yIsOne ) {
    puts("S"); return 0;
  }
  if( xIsTwo and yIsTwo ) {
    puts("E"); return 0;
  }
  puts("P"); return 0;
  
  
    
  
  return 0;
}
0