# board = []
# count = 0
#
# for i in range(19):
# board.append(list(map(int, input().split())))
#
# def side(y, x, num, dx, dy):
# if x == 19 or y == 19 or x < 0 or y < 0 or (y+dy) > 19 or (x+dx) > 19:
# return 0
# # if (y == 18 and x == 18):
# # print("test: ",y, x)
#
# if board[y][x] == num:
# return 1+side(y+dy,x+dx, num, dx, dy)
# else:
# return 0
#
# stop = True
#
# for y in range(19):
# for x in range(19):
# if board[y][x] == 1 or board[y][x] == 2:
# i = board[y][x]
# li = []
# count = side(y, x, i, 0, 1) + side(y, x, i, 0, -1)-1
# li.append(count)
# count = side(y, x, i, 1, 0) + side(y, x, i, -1, 0)-1
# li.append(count)
# count = side(y, x, i, 1, -1)
# li.append(count)
# count = side(y, x, i, 1, 1) + side(y, x, i, -1, -1)-1
# li.append(count)
#
# if li.__contains__(5):
# print(board[y][x])
# print(y+1,x+1)
# stop = False
# break
#
# if stop == False:
# break
#
# if stop:
# print(0)
# #
#
# # for i in range(10):
# # for j in range(10):
# # print([i, j], end=" ")
# #
# # print()
# virus = []
# worm = []
#
# computer = int(input())
# connect = int(input())
#
# for i in range(connect):
# connections = list(map(int, input().split()))
# if connections.__contains__(1):
# virus.append(connections)
# else:
# for i in range(len(virus)):
# if connections.__contains__(virus[i][1]):
# virus.append(connections)
# break
#
# print(virus)
# for i in virus:
# for j in i:
# if not j in worm:
# worm.append(j)
#print(len(worm)-1)
computer = int(input())
connect = int(input())
computers = []
for i in range(connect):
computers.append(list(map(int, input().split())))
def getConnect(num):
host = computers[num][1]
for i in range(len(computers)):
if computers[i][1] == host and computers[i][1] != 0:
print(computers[i][1])
for i in range(len(computers)):
if computers[i][0] == 1:
getConnect(i)
computers[i] = [0, 0]
top of page
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
211027
211027
댓글 0개
좋아요
댓글(0)
bottom of page