diff --git "a/LJEDD2/\355\224\214\353\241\234\354\235\264\353\223\234 \354\233\214\354\205\234/\354\271\234\352\265\254.py" "b/LJEDD2/\355\224\214\353\241\234\354\235\264\353\223\234 \354\233\214\354\205\234/\354\271\234\352\265\254.py" new file mode 100644 index 0000000..ccc6017 --- /dev/null +++ "b/LJEDD2/\355\224\214\353\241\234\354\235\264\353\223\234 \354\233\214\354\205\234/\354\271\234\352\265\254.py" @@ -0,0 +1,21 @@ +import sys +input = sys.stdin.readline + +n = int(input()) +graph = [list(input().strip()) for _ in range(n)] +visited = [[0] * n for _ in range(n)] + +for k in range(n): + for i in range(n): + for j in range(n): + if i == j: + continue + + # 2-친구인 경우 + if graph[i][j] == 'Y' or (graph[i][k] == 'Y' and graph[k][j] == 'Y'): + visited [i][j] = 1 + +res = 0 +for row in visited: + res = max(res,sum(row)) +print(res) \ No newline at end of file