a=[] b=[] r=[] for i in range(3): c,d=map(int, input().split()) a.append(c) b.append(d) for i in range(3): if a.count(a[i])==1: r.append(a[i]) if b.count(b[i])==1: r.append(b[i]) print(r[0],r[1])
으로 답변 제출을 했습니다.
그러나 이 것은 오답처리가 되었습니다.
x_nums = [] y_nums = [] for _ in range(3): x, y = map(int, input().split()) x_nums.append(x) y_nums.append(y)
for i in range(3): if x_nums.count(x_nums[i]) == 1: x4 = x_nums[i] if y_nums.count(y_nums[i]) == 1: y4 = y_nums[i] print(x4, y4)
이렇게 재출했을 때는 정답으로 처리되었습니다.
똑같은 알고리즘 사용인데 하나는 정답처리되고 하나는 오답처리입니다. 수정이 필요할 것 같습니다.
iviolin2003 4년 전
python을 이용하여 문제를 풀고 있습니다.
제가 제출했던 답변은
a=[]
b=[]
r=[]
for i in range(3):
c,d=map(int, input().split())
a.append(c)
b.append(d)
for i in range(3):
if a.count(a[i])==1:
r.append(a[i])
if b.count(b[i])==1:
r.append(b[i])
print(r[0],r[1])
으로 답변 제출을 했습니다.
그러나 이 것은 오답처리가 되었습니다.
x_nums = []
y_nums = []
for _ in range(3):
x, y = map(int, input().split())
x_nums.append(x)
y_nums.append(y)
for i in range(3):
if x_nums.count(x_nums[i]) == 1:
x4 = x_nums[i]
if y_nums.count(y_nums[i]) == 1:
y4 = y_nums[i]
print(x4, y4)
이렇게 재출했을 때는 정답으로 처리되었습니다.
똑같은 알고리즘 사용인데 하나는 정답처리되고 하나는 오답처리입니다. 수정이 필요할 것 같습니다.