We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e2db01 commit 8c7ec7dCopy full SHA for 8c7ec7d
1 file changed
live10/test104/문제2/박희경.py
@@ -0,0 +1,22 @@
1
+import sys
2
+
3
+input = sys.stdin.readline
4
5
+n = int(input())
6
+friends = [list(map(str, input().rstrip())) for _ in range(n)]
7
+relation = [[0] * n for _ in range(n)]
8
9
10
+for k in range(n):
11
+ for i in range(n):
12
+ for j in range(n):
13
+ if i == j:
14
+ continue
15
+ if (friends[i][k] == 'Y' and friends[k][j] == 'Y') or friends[i][j] == 'Y':
16
+ relation[i][j] = 1
17
18
+print(relation)
19
+max_count = 0
20
+for r in relation:
21
+ max_count = max(max_count, sum(r))
22
+print(max_count)
0 commit comments