File tree Expand file tree Collapse file tree 1 file changed +1
-29
lines changed Expand file tree Collapse file tree 1 file changed +1
-29
lines changed Original file line number Diff line number Diff line change 1
- class Point :
2
- def __init__ (self , x , y , z ):
3
- self .x = x
4
- self .y = y
5
- self .z = z
6
-
7
- def __str__ (self ):
8
- return "[" + str (x ) + ", " + str (y ) + ", " + str (z ) + "]"
9
-
10
- def comparator (self , other ):
11
- if self .x == other .x :
12
- if self .y == other .y :
13
- if self .z < other .z :
14
- return - 1
15
- elif self .z == other .z :
16
- return 0
17
- else :
18
- return 1
19
- elif self .y < other .y :
20
- return - 1
21
- else : return 0
22
- else :
23
- if self .x < other .x :
24
- return - 1
25
- else : return 1
26
-
27
-
28
1
x = int (input ())
29
2
y = int (input ())
30
3
z = int (input ())
31
4
n = int (input ())
32
5
33
- result = [[a , b , c ] for a in range (x + 1 ) for b in range (y + 1 ) for c in range (z + 1 ) if a + b + c != n ]
34
- print (result )
6
+ print ([[a , b , c ] for a in range (x + 1 ) for b in range (y + 1 ) for c in range (z + 1 ) if a + b + c != n ])
You can’t perform that action at this time.
0 commit comments