백준 문제 풀이
백준 7568 파이썬 python : 덩치 @@황소처럼 우직하게@@
hjp845
2020. 2. 23. 13:31
반응형
혹시나 시간초과가 나면 어쩔까 했는데
시간복잡도 n^2 으로 풀어도 괜찮다.
import sys
r = sys.stdin.readline
people = []
n = int(r())
for i in range(n):
x, y = map(int, r().split())
people.append([x, y])
for i in range(n):
total = 1
for j in range(n):
if i == j:
continue
if people[j][0] > people[i][0] and people[j][1] > people[i][1]:
total += 1
print(total, end=" ")
이런 단순한 문제를 보면 시간초과 공포증이 있다;;
TIME LIMIT POBIA
반응형