1926. 간단한 369게임
·
swea
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PTeo6AHUDFAUq#none SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com n = int(input()) nums = [x for x in range(1,n+1)] clap = [3,6,9] for i in range(n): lst = [] cnt = 0 k = nums[i] while k> 0: # 자릿수 분리 lst.append(k % 10) k = k // 10 for c in clap: # 3, 6, 9가 들어가는 횟수 세기 cnt += lst.count(..
7087. 문제 제목 붙이기
·
swea
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWkIdD46A5EDFAXC&categoryId=AWkIdD46A5EDFAXC&categoryType=CODE&problemTitle=7087&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com T = int(input()) for tc in range(1,T+1): N = int(input()) titles = [input() for ..
알고리즘 Tree
·
ssafy
보호되어 있는 글입니다.
4613. 러시아 국기 같은 깃발
·
swea
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWQl9TIK8qoDFAXj&categoryId=AWQl9TIK8qoDFAXj&categoryType=CODE&problemTitle=%EB%9F%AC%EC%8B%9C%EC%95%84&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com def check(start, end, color): global cnt for r in range(s..
16811. 당근 포장하기
·
swea
https://swexpertacademy.com/main/code/userProblem/userProblemDetail.do?contestProbId=AYamNLoKGSgDFAVx SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com T = int(input()) for tc in range(1, T + 1): N = int(input()) arr = sorted(list(map(int, input().split()))) # 오름차순 정렬 min_c = 1000 # 주어진 최대 당근의 개수 for i in range(N - 2): # 소 for j in range(i + 1, N - 1): # 중 if arr[i]..
백준 1244. 스위치 켜고 끄기
·
백준
https://www.acmicpc.net/problem/1244 1244번: 스위치 켜고 끄기 첫째 줄에는 스위치 개수가 주어진다. 스위치 개수는 100 이하인 양의 정수이다. 둘째 줄에는 각 스위치의 상태가 주어진다. 켜져 있으면 1, 꺼져있으면 0이라고 표시하고 사이에 빈칸이 하나씩 www.acmicpc.net def switch(k): if s[k] == 0: s[k] = 1 else: s[k] = 0 return n = int(input()) # 스위치 개수 s = [-1] + list(map(int,input().split())) # 스위치 상태 stu = int(input()) # 학생수 for _ in range(stu): gen,num = map(int,input().split()) if..