結果

問題 No.1057 素敵な日
コンテスト
ユーザー mer
提出日時 2020-05-25 04:55:17
言語 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
結果
WA  
実行時間 -
コード長 433 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 163 ms
コンパイル使用メモリ 36,320 KB
最終ジャッジ日時 2026-02-22 05:44:09
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
int main(void){
    //宣言
    int A,B,ans;
    //入力
    scanf("%d",&A);
    scanf("%d",&B);
    //処理
        //Aの値がBの値より大きい場合
    if (B < A) {
        ans = (A+B)-(A-B);
    }   //AとBが同じ値の場合
    else if (A = B) {
        ans = A+B-1;
    }   //Bの値がAの値より大きい場合
    else {
        ans = (A+B)-(B-A);
    }
    //出力
    printf("%d",ans);
}
0