代码问题求助!
  • 板块灌水区
  • 楼主YuTianQwQ
  • 当前回复3
  • 已保存回复3
  • 发布时间2023/9/2 20:34
  • 上次更新2023/11/2 23:47:53
查看原帖
代码问题求助!
655082
YuTianQwQ楼主2023/9/2 20:34

代码在本地编译器答案是正确的,在小破谷编译器只会输出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

*/
2023/9/2 20:34
加载中...