代码在本地编译器答案是正确的,在小破谷编译器只会输出0怎么办??
#include<bits/stdc++.h>
using namespace std;
#define FASTOI ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
inline int read(){
int x = 0, f = 0; char ch = getchar();
while (!isdigit(ch)) f |= (ch == '-'), ch = getchar();
while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
return f ? -x : x;
}
int arr[105][105];
int main()
{
FASTOI;
int n = read(),cnt = 0;
for(int i = 0;i < n;i++)
{
int a,b,c,d;
cin >> a >> b >> c >> d;
for(int j = c;j < d;j++)
for(int k = a;k < b;k++)
arr[j][k] = 1;
}
for(int i = 0;i < 101;i++)
for(int j = 0;j < 101;j++)
if(arr[i][j] == 1)
cnt++;
cout << cnt;
return 0;
}
/*
3
0 5 1 3
1 4 0 5
2 5 2 4
*/