[Python] 백준 문제풀이 3052번 - 나머지
https://www.acmicpc.net/problem/3052 3052번: 나머지 각 수를 42로 나눈 나머지는 39, 40, 41, 0, 1, 2, 40, 41, 0, 1이다. 서로 다른 값은 6개가 있다. www.acmicpc.net 풀이 int_list = [] for i in range(0, 10): int_list.append(int(input())) rest_list = {} # 나머지를 키로 딕셔너리를 만들어준다. # rest_list 길이 값이 답 for i in int_list: if i % 42 not in rest_list: rest_list[i % 42] = 0 # 몇개인지 체크 해준다.(문제랑 상관없음) rest_list[i % 42] += 1 print(len(rest_lis..
2023. 5. 6.