Algorithm/goorm

goorm 여름의 대삼각형, 배열 합치기

마띠(쥔장) 2020. 8. 30. 00:00

여름의 대삼각형

# -*- coding: utf-8 -*-
# UTF-8 encoding when using korean
x1, y1 = map(int, input().split(' '))
x2, y2 = map(int, input().split(' '))
x3, y3 = map(int, input().split(' '))
S = (x1*y2 + x2*y3 + x3*y1) - (x1*y3 + x3*y2 + x2*y1)
if S < 0:
	S = -S
print("%.2f" %(S/2))

 

배열 합치기

# -*- coding: utf-8 -*-
# UTF-8 encoding when using korean
a_size, b_size = map(int, input().split(" "))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.extend(b)
a.sort()
for i in range (len(a)):
	print(a[i], end = ' ')

 

 

 

728x90