Light Oj 1211 计算多个立方体重叠部分体积 您所在的位置:网站首页 三个正方体重叠的画法 Light Oj 1211 计算多个立方体重叠部分体积

Light Oj 1211 计算多个立方体重叠部分体积

2024-07-10 15:51| 来源: 网络整理| 查看: 265

Intersection of Cubes Time Limit:500MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1211 Description You are given n cubes, each cube is described by two points in 3D space: (x1, y1, z1) being one corner of the cube and (x2, y2, z2) being the opposite corner. Assume that the sides of each of the cubes are parallel to the axis. Your task is to find the volume of their intersection. Input Input starts with an integer T (≤ 100), denoting the number of test cases. Each case starts with a line containing an integer n (1 ≤ n ≤ 100). Each of the next n lines contains six integers x1 y1 z1 x2 y2 z2 (1 ≤ x1, y1, z1, x2, y2, z2 ≤ 1000, x1 < x2, y1 < y2, z1 < z2) where (x1, y1, z1) is the co-ordinate of one corner and (x2, y2, z2) is the co-ordinate of the opposite corner. Output For each case, print the case number and volume of their intersection. Sample Input 2 2 1 1 1 3 3 3 1 1 1 2 2 2 3 7 8 9 20 20 30 2 2 2 50 50 50 13 14 15 18 30 40 Sample Output Case 1: 1 Case 2: 450

/********************************************* author : Grant Yuan time : 2014.8.7 algorithm: 计算几何 source : Light Oj 1211 explain : 求几个正方体重叠部分的体积 ***********************************************/ #include #include #include #include #include #define INF 0x3fffffff using namespace std; int t,n,a[7]; int ans; int main() { scanf("%d",&t);int c; for(int i=1;i


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有