-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQ4.java
More file actions
39 lines (34 loc) · 846 Bytes
/
Copy pathQ4.java
File metadata and controls
39 lines (34 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package microsoft;
import java.util.Scanner;
public class Q4 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int kk=0; kk<T; kk++){
int N = sc.nextInt();
int[][] in = new int[N][3];
int maxx = 0;
int maxy = 0;
int maxz = 0;
for(int i=0; i<N; i++){
in[i][0] = sc.nextInt() - 1;
in[i][1] = sc.nextInt() - 1;
in[i][2] = sc.nextInt() - 1;
maxx = Math.max(maxx, in[i][0]);
maxy = Math.max(maxy, in[i][1]);
maxz = Math.max(maxz, in[i][2]);
}
boolean[][][] map = new boolean[maxx][maxy][maxz];
for(int i=0; i<maxx; i++){
for(int j=0; j<maxy; j++){
for(int k=0; k<maxz; k++){
map[i][j][k] = false;
}
}
}
for(int i=0; i<N; i++){
map[ in[i][0] ][ in[i][1] ][ in[i][2] ] = true;
}
}
}
}