https://www.acmicpc.net/problem/23246n = int(input())arr = []rank = []for _ in range(n): score = list(map(int, input().split())) m = score[1] * score[2] * score[3] s = sum(score[1:]) n = score[0] arr.append([m, s, n])rank = sorted(arr)for i in range(3): print(rank[i][2], end = ' ') ์๊ฐ์ฒซ ๋ฒ์งธ ๋ฐฐ์ด ์นธ์๋ ๊ณฑ, ๋ ๋ฒ์งธ ๋ฐฐ์ด ์นธ์๋ ํฉ, ์ธ ๋ฒ์งธ ๋ฐฐ์ด ์นธ์๋ ๋ฑ๋ฒํธ๋ฅผ ๋ฃ์ด์ฃผ๊ณ ์ ๋ ฌํ๋ฉด ๋๋ ๋ฌธ์
๐คฏ ๋ฌธ์ ํ์ด
https://www.acmicpc.net/problem/11650n = int(input())arr = []for _ in range(n): nums = list(map(int, input().split())) arr.append(nums)arr.sort()for num in arr: print(num[0], num[1]) ์๊ฐ์ค๋ฆ์ฐจ์ ์ ๋ ฌ๋ง ํ๋ฉด ๋๋ ๊ฐ๋จํ ๋ฌธ์
https://www.acmicpc.net/problem/10974n = int(input())arr = [i for i in range(1, n + 1)]check = [False] * nchoose = []def permutation(level): if level == n: print(*choose) return for i in range(n): if check[i] == True: continue choose.append(arr[i]) check[i] = True permutation(level + 1) check[i] = False choose.pop()permutation(0) ์๊ฐ์ ๋ชฉ ๊ทธ๋๋ก ์์ด ๋ฌธ์ , ์กฐํฉ๊ณผ ๋น์ทํ ๋ฐฉ์์ผ๋ก ํ๋ฉด ๋..
https://www.acmicpc.net/problem/1759l, c = map(int, input().split())arr = list(map(str, input().split()))arr.sort()choose = []check = ['a', 'e', 'i', 'o', 'u']def combination(index, level): if level == l: cnt, cnt2 = 0, 0 for ch in choose: if ch in check: cnt += 1 else: cnt2 += 1 if cnt >= 1 and cnt2 >= 2: print(''.join(choose)) return for i in range(..
https://www.acmicpc.net/problem/6603n = 0choose = []def combination(lst, index, level): if level == 6: print(*choose) return for i in range(index, n): choose.append(lst[i]) combination(lst, i + 1, level + 1) choose.pop()while True: t = list(map(int, input().split())) if t[0] == 0: break n = t[0] arr = t[1:] combination(arr, 0, 0) choose.clear() print() ์๊ฐ๋์ถฉ k๊ฐ์ ์ซ์ ์ค์..
https://www.acmicpc.net/problem/4779์ฌ๊ท ํจ์def cantor(n): if n == 1: return '-' return cantor(n // 3) + ' ' * (n // 3) + cantor(n // 3)while True: try: n = int(input()) print(cantor(3 ** n)) except: break Bottom Updef cantor(n): arr = [''] * (3 ** n) arr[0] = '-' for i in range(1, n + 1): arr[i] = arr[i - 1] + ' ' * 3 ** (i - 1) + arr[i - 1] print(arr[n])while True: try: ..
https://www.acmicpc.net/problem/10870def fibonacci(n): if n == 0 or n == 1: return n return fibonacci(n - 1) + fibonacci(n - 2)n = int(input())print(fibonacci(n))