본문 바로가기

컴퓨터과학/Algorithm

(21)
[Python] [백준] 1009번 분산처리 1009번: 분산처리 입력의 첫 줄에는 테스트 케이스의 개수 T가 주어진다. 그 다음 줄부터 각각의 테스트 케이스에 대해 정수 a와 b가 주어진다. (1 ≤ a < 100, 1 ≤ b < 1,000,000) www.acmicpc.net 문제 재용이는 최신 컴퓨터 10대를 가지고 있다. 어느 날 재용이는 많은 데이터를 처리해야 될 일이 생겨서 각 컴퓨터에 1번부터 10번까지의 번호를 부여하고, 10대의 컴퓨터가 다음과 같은 방법으로 데이터들을 처리하기로 하였다. 1번 데이터는 1번 컴퓨터, 2번 데이터는 2번 컴퓨터, 3번 데이터는 3번 컴퓨터, ... , 10번 데이터는 10번 컴퓨터, 11번 데이터는 1번 컴퓨터, 12번 데이터는 2번 컴퓨터, ... 총 데이터의 개수는 항상 ab개의 형태로 주어진다...
[Python] [백준] 2490번 윷놀이 2490번: 윷놀이 우리나라 고유의 윷놀이는 네 개의 윷짝을 던져서 배(0)와 등(1)이 나오는 숫자를 세어 도, 개, 걸, 윷, 모를 결정한다. 네 개 윷짝을 던져서 나온 각 윷짝의 배 혹은 등 정보가 주어질 때 도(배 한 www.acmicpc.net 문제 우리나라 고유의 윷놀이는 네 개의 윷짝을 던져서 배(0)와 등(1)이 나오는 숫자를 세어 도, 개, 걸, 윷, 모를 결정한다. 네 개 윷짝을 던져서 나온 각 윷짝의 배 혹은 등 정보가 주어질 때 도(배 한 개, 등 세 개), 개(배 두 개, 등 두 개), 걸(배 세 개, 등 한 개), 윷(배 네 개), 모(등 네 개) 중 어떤 것인지를 결정하는 프로그램을 작성하라. 입력 첫째 줄부터 셋째 줄까지 각 줄에 각각 한 번 던진 윷짝들의 상태를 나타내는 네..
[SQL] [Codewars] 6Kyu - SELECT prime numbers Codewars: Achieve mastery through coding challenge Codewars is a coding practice site for all programmers where you can learn various programming languages. Join the community and improve your skills in many languages! www.codewars.com 문제 Write a SELECT query which will return all prime numbers smaller than 100 in ascending order. Your query should return one column named prime. 코드 CREATE OR REP..
[SQL] [Codewars] 7Kyu - SQL: Regex Replace Codewars: Achieve mastery through coding challenge Codewars is a coding practice site for all programmers where you can learn various programming languages. Join the community and improve your skills in many languages! www.codewars.com 문제 You are given a table named repositories, format as below: ** repositories table schema ** project commits contributors address The table shows project names o..
[SQL] [Codewars] 7kyu - Simple Fun #74: Growing Plant Codewars: Achieve mastery through coding challenge Codewars is a coding practice site for all programmers where you can learn various programming languages. Join the community and improve your skills in many languages! www.codewars.com 문제 Task Each day a plant is growing by upSpeed meters. Each night that plant's height decreases by downSpeed meters due to the lack of sun heat. Initially, plant ..