问,为什么会RE
查看原帖
问,为什么会RE
1039538
gaoyunxuan0917楼主2024/8/23 15:32
#include<bits/stdc++.h>
using namespace std;
int w, x, h, q;
int a[25][25][25];
int f() {
	int x1, y1, z1, x2, y2, z2;
	cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
    for (int i = x1; i <= x2; i++) {
        for(int j = y1; j <= y2; j++) {
            for(int k = z1; k <= z2; k++) {
                a[i][j][k] = 1;
            }
        }
    }
}
int main() {
	cin >> w >> x >> h;
	cin >> q;
    for(int i = 1; i <= q; i++) {
        f();
    }
    int s = 0;
    for(int i = 1; i <= w; i++) {
        for(int j = 1; j <= x; j++) {
            for(int k = 1; k <= h; k++) {
                if(a[i][j][k] == 0) {
					s++;
				}
			}
        }
	}         
    cout << s;
    return 0;
}
2024/8/23 15:32
加载中...