• API
• FAQ
• Tools
• Archive
SHARE
TWEET asss 31 a guest Mar 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import sys
2. def compare_matrix(m, d,ranger):
3.     n = []
4.     for point in m:
5.         counter = 0
6.         for i in range(int(d)):
7.             if ranger[:i] <= point[i] <= ranger[i:]:
8.                 n.append(i)
9.             #if x1[i] <= point[i] <= x2[i]:
10.                 counter += 1
11.
12.         if counter == d:
13.             n.append(point)
14.     return n
15.
16. x1, x2 = ((2, 0), (11, 21))
17. matrix = [[1, 2],[10, 20]]
18. #print(str(comp_matrix(matrix, 2)))
19.
20. my_input = sys.stdin.readline().split()
21. lst_0 = []
22.
23. for rows in range(int(my_input)):
24.     xx = sys.stdin.readline().split()
25.     xx = list(map(int, xx))
26.     lst_0.append(xx)
27.
28. motherfucker_range = []
29. for i in range(int(my_input)):
30.     ranges = sys.stdin.readline().replace('[','').replace(']', '').split()
31.     motherfucker_range.append(ranges)
32.     motherfucker_range[i] = [int(x) for x in motherfucker_range[i]]
33.     print(motherfucker_range)
34.
35. for item in range(int(my_input)):
36.     newmatrix = str(compare_matrix(lst_0, my_input, motherfucker_range)).replace('[','').replace(']','').replace(',','')
37.     print(newmatrix)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!

Top