結果

問題 No.441 和か積
コンテスト
ユーザー monburan_0401
提出日時 2018-09-27 01:08:53
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 547 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 125 ms
コンパイル使用メモリ 36,416 KB
最終ジャッジ日時 2026-02-22 01:55:02
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>
int main(void){
    char A[201];
    char B[201];

    scanf("%s %s",A,B);

    //  If A or B is "1" or "0", the answer is "S"
    //  If A and B is "2", the answer is "E"
    //  else the answer is "P"

    if(((strcmp(A,"2") == 0)&&(strcmp(B,"2") == 0))||((strcmp(A,"0") == 0)&&(strcmp(B,"0") == 0))){
        printf("E\n");
    }else if((strcmp(A,"0") == 0)||(strcmp(B,"0") == 0)||(strcmp(A,"1") == 0)||(strcmp(B,"1") == 0)){
        printf("S\n");
    }else{
        printf("P\n");
    }

    return 0;
}
0