编程介的小学生 2019-08-29 23:51 采纳率: 20.5%
浏览 85

程序设计用C语言,stars

Problem Description
John loves to see the sky. A day has Q times. Each time John will find a new star in the sky, or he wants to know how many stars between (x1,y1,z1) and (x2,y2,z2).

Input
The first line contains a single integer T(1≤T≤10) (the data for Q>100 less than 6 cases),, indicating the number of test cases.
The first line contains an integer Q(1≤Q≤50000),indicating how many times in a day.
Next Q lines contain some integers, first input an integer A(1≤A≤2).If A=1 then input 3 integers x, y and z, indicating a coordinate of one star.. If A=2 then input 6 integers x1,y1,z1,x2,y2,z2(1≤x,y,z,x1,y1,z1,x2,y2,z2≤109,x1≤x2,y1≤y2,z1≤z2).

Output
For each “A=2”,output an integer means how many stars in such a section.

Sample Input
2
11
1 1 1 1
2 1 1 1 1 1 1
1 2 2 2
1 1 1 2
2 1 1 1 2 2 2
1 3 3 3
1 4 4 4
1 5 5 5
1 6 6 6
2 1 1 1 6 6 6
2 3 3 3 6 6 6
11
1 1 1 1
2 1 1 1 1 1 1
1 2 2 2
1 1 1 2
2 1 1 1 2 2 2
1 3 3 3
1 4 4 4
1 5 5 5
1 6 6 6
2 1 1 1 6 6 6
2 3 3 3 6 6 6

Sample Output
1
3
7
4
1
3
7
4

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c程序不知道为什么得不到结果
    • ¥40 复杂的限制性的商函数处理
    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置