思路:先算出一共有多少个方块,然后每次输入蒸发的范围就减去蒸发的方块数量。
样例也是对的。
代码如下qwq:
#include <iostream>
using namespace std;
int x, y, z, x1, x2, y1, y2, z1, z2, n, t;
int main(){
cin >> x >> y >> z;
t = x * y * z;
cin >> n;
for(int i = 1; i <= n; i++){
cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
t -= (x2 - x1 + 1) * (y2 - y1 + 1) * (z2 - z1 + 1);
}
cout << t;
return 0;
}