목록분류 전체보기 (317)
지나가던 개발자

while True: a = int(input()) if a == 0: break print(int(a*(a+1)/2)) 참 오랜만에 푼 문제이다... 정말 쉬운 문제이다. 피라미드를 쌓는데에 윗칸부터 {1, 2, 3, 4, ..., n-2, n-1, n} 개의 블록이 쓰일 것이므로 공차가 1인 등차수열의 합 공식을 사용하여 문제를 풀어 주면 된다.

from collections import Counter;print(Counter(sorted([input() for i in range(int(input()))])).most_common()[0][0])

n, m = map(int, input().split()) book = [] for i in range(n): book.append(input()) for i in range(len(book)): if book[i][0] == "

alljobs = set([input() for i in range(int(input()))]) alreadydid = set([input() for i in range(int(input()))]) print(len(alljobs-alreadydid)) [print(x) for x in list(alljobs-alreadydid)]

n, m = map(int,input().split()) l = [[int(x[0]), int(x[1]), x[2]] for x in [input().split() for i in range(m)]] for i in range(max([x[1] for x in l])+1): toPrint = sorted([x for x in l if x[1]==i], key=lambda x:x[0]) if toPrint!=[]: for j in toPrint: print(j[-1],end="")

a,b,c = int(input()), int(input()), int(input()) if a==b==c: print("Equilateral") elif a==b or b==c or c==a: print("Isosceles") else: if a+b+c==180: print("Scalene") else: print("Error")

tensyu = [0, 0, 0] santen = [0, 0, 0] niten = [0, 0, 0] for i in range(int(input())): a = list(map(int, input().split())) tensyu[0] += a[0] tensyu[1] += a[1] tensyu[2] += a[2] if a[0] == 3: santen[0] += 1 elif a[1] == 3: santen[1] += 1 else: santen[2] += 1 if a[0] == 2: niten[0] += 1 elif a[1] == 2: niten[1] += 1 else: niten[2] += 1 #print(tensyu, santen, niten) if len(set(tensyu)) == len(tensyu..

위와 같은 삼각형 ABC의 A에서 선분 BC에 내린 중점 M과 A에서 선분 BC에 내린 수선의 발 H에 관해서 다음과 같은 식이 성립한다. $$ \overline{AB}^2 + \overline{AC}^2 = $$ $$ (\overline{BH}^2+\overline{AH}^2)+(\overline{HC}^2+\overline{AH}^2)= $$ $$ \overline{BH}^2+\overline{HC}^2+2\overline{AH}^2= $$ $$ (\overline{BM}+\overline{MH})^2+(\overline{CM}-\overline{MH})^2+2\overline{AH}^2= $$ $$ (\overline{BM}+\overline{MH})^2+(\overline{BM}-\overline..