Softeer - 현대자동차그룹 SW인재확보플랫폼
softeer.ai
2가지 방식으로 코드를 작성할 수 있다.
import sys
n, m = list(map(int,input().split()))
w = list(map(int,sys.stdin.readline().split()))
best = [True] * n
for i in range(m):
friend = list(map(int,sys.stdin.readline().split()))
f1, f2 = list(map(lambda x:x-1, friend))
if w[f1] >= w[f2] and best[f2]:
best[f2] = False
if w[f1] <= w[f2] and best[f1]:
best[f1] = False
print(len(list(filter(lambda n:n, best))))
Algorithm with python (1) | 2024.02.01 |
---|---|
[소프티어] 스마트 물류 (0) | 2024.02.01 |
[소프티어] 지도 자동 구축 (0) | 2024.01.31 |
[소프티어] 강의실 배정 (0) | 2024.01.30 |
[소프티어] GBC (0) | 2024.01.30 |