-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathb367.py
More file actions
31 lines (30 loc) · 726 Bytes
/
b367.py
File metadata and controls
31 lines (30 loc) · 726 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
#方法一
# n = int(input())
# for _ in range(n):
# c, d = map(int, input().split())
# a = []
# for _ in range(c):
# a.append(list(map(int, input().split())))
# flag = True
# for i in range(c):
# for j in range(d):
# if a[i][j] != a[c-1-i][d-1-j]:
# flag = False
# break
# if flag:
# print('go forward')
# else:
# print('keep defending')
#方法二
n = int(input())
for _ in range(n):
c, d = map(int, input().split())
a = []
for _ in range(c):
a.extend(list(map(int, input().split())))
b = a[:]
a.reverse()
if a != b:
print('keep defending')
else:
print('go forward')