提交时间:2024-05-03 12:13:50

运行 ID: 46388

#include<bits/stdc++.h> using namespace std; bool k[505][505]; int ans; int main(){ int n; cin>>n; int x1,y1,x2,y2; while(n--){ cin>>x1>>y1>>x2>>y2; for(int i=y1+1;i<=y2;i++){ for(int j=x1+1;j<=x2;j++){ k[i][j]=true; } } } for(int i=1;i<=y2;i++){ for(int j=1;j<=x2;j++){ if(k[i][j]){ ans++; } } } cout<<ans; return 0; }