-
[백준 문제풀이] 얼렁뚱땅 1713번 후보 추천 풀이얼렁뚱땅 백준 문제풀이 2022. 4. 20. 16:00
시뮬레이션 유형 처음 풀어봄
https://www.acmicpc.net/problem/1713 import sys n = int(sys.stdin.readline()) int(sys.stdin.readline()) list_ = list(map(int, sys.stdin.readline().split())) q = [] count = [] for i in range(len(list_)) : if list_[i] in q : index_ = q.index(list_[i]) count[index_] += 1 else : if len(q) < n : q.append(list_[i]) count.append(1) else: small = min(count) for j in range(len(count)) : if small == count[j] : temp=j break del q[temp] del count[temp] q.append(list_[i]) count.append(1) q.sort() for i in range(len(q)) : print(q[i], end= ' ')
'얼렁뚱땅 백준 문제풀이' 카테고리의 다른 글
[백준 문제풀이] 얼렁뚱땅 21736번 헌내기는 친구가 필요해 풀이 (0) 2022.04.30 [백준 문제풀이] 얼렁뚱땅 1063번 킹 문제풀이 (0) 2022.04.29 [백준 문제풀이] 얼렁뚱땅 16208번 귀찮음 풀이 (0) 2022.04.20 [백준 문제풀이] 얼렁뚱땅 2644번 촌수계산 풀이 (0) 2022.04.19 [백준 문제풀이] 얼렁뚱땅 16171번 나는 친구가 적다(small) 풀이 (0) 2022.04.19