SWEA 11

[SWEA] 5658. 보물상자 비밀번호 python, c++

SW Expert Academy 5658. [모의 SW 역량테스트] 보물상자 비밀번호 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 삼성 기출을 대비한 문제. 문자열을 사용하는 문제이고 쉬운 문제이다. 문자열을 회전시켜가며 k번째 큰 수를 출력하면된다. 문자열을 회전시킬때 조금 쉽게 하기위해 받은 문자열의 맨 처음글자부터 N//4까지의 글자를 복사해서 뒤에 넣어주었고 반복문을 사용해서 특정 길이까지 잘라서 set에 넣어주었다. set은 중복값이 제거되므로 넣어주기만 하면 된다. 모든 문자열을 순회한 이후엔 정렬을 한뒤 찾는 자리의 값을 반환했다. def find_number(string, string_size..

STUDY/Algorithm 2022.03.17

[SWEA] 2105. [모의 SW 역량테스트] 디저트 카페

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5VwAr6APYDFAWu SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com import sys sys.stdin = open("swea_2105.txt", "r") T = int(input()) for tc in range(1, 1 + T): N = int(input()) matrix = [list(map(int,input().split())) for _ in range(N)] answer = -1 # [1,1], [1,2],[2,1], ~, [1,19], ~ ,[19,1..

STUDY/Algorithm 2021.07.29

[SWEA] 1767 프로세서 연결하기 python

swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV4suNtaXFEDFAUf&categoryId=AV4suNtaXFEDFAUf&categoryType=CODE&problemTitle=SW&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=3 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com import sys sys.stdin = open('./sample_input_1.txt', 'r') for tc in range(1, int(input()) +..

STUDY/Algorithm 2021.03.17

[SWEA] 4013 특이한자석

swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWIeV9sKkcoDFAVH SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com from collections import deque for tc in range(1, int(input()) + 1): k = int(input()) magnet = [0] + [deque(list(map(int, input().split()))) for _ in range(4)] # 접점 (1-2,2-6),(2-2,3-6),(3-2,4-6) # N극 0, S극 1 # 시계방향 1, 반시계 -1 for i in..

STUDY/Algorithm 2021.03.16

[SWEA] 1952 수영장

swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PpFQaAQMDFAUq&categoryId=AV5PpFQaAQMDFAUq&categoryType=CODE&problemTitle=1952&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com for tc in range(1, int(input()) + 1): prices = list(map(int, input().split())) months = ..

STUDY/Algorithm 2021.03.14

[SWEA] 10966 물놀이를 가자

swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AXWXMZta-PsDFAST&categoryId=AXWXMZta-PsDFAST&categoryType=CODE&problemTitle=10966 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com from collections import deque for tc in range(1, int(input()) + 1): n, m = map(int, input().split()) visited = [[-1] * m for _ in range(n)] _map = [] q = deque() for i..

STUDY/Algorithm 2021.03.14

[SWEA] 1953 탈주범 검거

swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PpLlKAQ4DFAUq&categoryId=AV5PpLlKAQ4DFAUq&categoryType=CODE&problemTitle=1953 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com from collections import deque tunnel = { 1: [(-1, 0), (1, 0), (0, -1), (0, 1)], # 상하좌우 2: [(-1, 0), (1, 0)], # 상하 3: [(0, -1), (0, 1)], # 좌우 4: [(-1, 0), (0, 1)], # 상우 ..

STUDY/Algorithm 2021.03.14

[백준, SWEA] BOJ 14889 스타트와 링크, swea4012 요리사

https://acmicpc.net/problem/14889 14889번: 스타트와 링크 예제 2의 경우에 (1, 3, 6), (2, 4, 5)로 팀을 나누면 되고, 예제 3의 경우에는 (1, 2, 4, 5), (3, 6, 7, 8)로 팀을 나누면 된다. www.acmicpc.net n = int(input()) s_ij = [list(map(int, input().split())) for i in range(n)] min_val = 100 * 20 visit = [0] * n def comb(index=0, arr=[]): if index == (n // 2): global min_val value = total_chk(arr) if min_val > value: min_val = value else:..

STUDY/Algorithm 2021.03.10

[SWEA] 5656_벽돌깨기, 모의역량테스트, 못푼 문제!!

깨진건 벽돌이 아니라 내 머리다. 못풀었다. 너무 어렵다... 타인의 코드를 봐야할지, 아니면 공부를 더하고 다시 봐야할지 모르겠다. 일단 이번주 주말까지는 보류... swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRQm6qfL0DFAUo&categoryId=AWXRQm6qfL0DFAUo&categoryType=CODE&problemTitle=%EC%97%AD%EB%9F%89&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! ..

STUDY/Algorithm 2021.02.23