백준 2456 나는 학급회장이다
https://www.acmicpc.net/problem/2456 2456번: 나는 학급회장이다 첫째 줄에는 반의 학생들의 수 N (3 ≤ N ≤ 1,000)이 주어진다. 다음 N개의 각 줄에는 각 학생이 제출한 회장후보 3명에 대한 선호 점수가 주어지는 데, 첫 번째 점수는 후보 1번에 대한 점수이고 두 www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 first,second,third=[],[],[] n=int(input()) for i in range(n): a,b,c=map(int, input().split()) first.append(a) second.append(b) third.append(c) first = [sum(first), firs..
2022. 10. 29.
백준 2947 나무 조각
https://www.acmicpc.net/problem/2947 2947번: 나무 조각 첫째 줄에 조각에 쓰여 있는 수가 순서대로 주어진다. 숫자는 1보다 크거나 같고, 5보다 작거나 같으며, 중복되지 않는다. 처음 순서는 1, 2, 3, 4, 5가 아니다. www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 nums=list(map(int, input().split())) answer=[1,2,3,4,5] def change(nums, start, end): if nums[start]> nums[end]: nums[start], nums[end] = nums[end], nums[start] print(*nums) return nums while nums!=answer: for..
2022. 10. 28.