結果

問題 No.799 赤黒かーどげぇむ
ユーザー kidhrn
提出日時 2019-07-31 23:29:21
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 320 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 28,032 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 07:20:16
合計ジャッジ時間 1,004 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

int main(void){
    
    int A,B,C,D;
    scanf("%d%d%d%d",&A,&B,&C,&D);

    int n=0;
    
    if(A<=C&&C<=B){
        if(D<=B)n=D-C+1;
        if(B<=D)n=B-C+1;}
    else if(C<A&&A<D){
        if(B<=D)n=B-A+1;
        if(D<=B)n=D-A+1;}
    
    printf("%d\n",(B-A+1)*(D-C+1)-n);
    
    return 0;
}
0