Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
35619 徐若宸 面积 C++ Accepted 1 MS 1268 KB 357 2024-01-04 21:12:28

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main(){ int n,a[510][510]={0},x1,x2,y1,y2; cin>>n; while(n--){ cin>>x1>>y1>>x2>>y2; for(int i=x1;i<x2;i++){ for(int j=y1;j<y2;j++){ a[i][j]=1; } } } int cnt=0; for(int i=1;i<=501;i++){ for(int j=1;j<=501;j++){ if(a[i][j]){ cnt++; } } } cout<<cnt; }


Judgement Protocol: