4 条题解

  • 0
    @ 2023-11-25 18:19:47
    using namespace std;
    struct twindow{
        int left,right,top,bottom;
    };
    twindow wina,winb,tmp;
    
    twindow indata(){
        twindow tmp;
        cin >> tmp.left >> tmp.right >> tmp.top >> tmp.bottom;
        return tmp;
    }
    
    int main(){
    
        wina = indata();
        winb = indata();
        tmp.left = max(wina.left,winb.left);
        tmp.right = min(wina.right,winb.right);
        tmp.top = max(wina.top,winb.top);
        tmp.bottom = min(wina.bottom,winb.bottom);
        int s = (tmp.right - tmp.left) * (tmp.bottom - tmp.top);
        if((tmp.right <= tmp.left) || (tmp.bottom <= tmp.top)) s = 0;
        cout << s << endl;
    	return 0;
    }
    

    信息

    ID
    387
    时间
    1000ms
    内存
    256MiB
    难度
    5
    标签
    递交数
    126
    已通过
    44
    上传者