본문 바로가기
300x250

전체 글244

시간이 지나 잘 되는 사람 자신의 실력이 곧 경쟁력이라 생각하여 실력을 쌓는데 집중을 다 하는 사람 어떻게 하면 더 나아질 수 있을지 고민하는 사람 언행이 바른 사람 신념이 있지만 자신의 신념보다 더 좋은 신념을 알게 되면 언제든 바뀔 수 있는 사람 많은 것을 하지 않고 중요한 것 하나에 모든 집중을 하는 사람 원하는 분야의 실력을 쌓고 최고가 되는 것이 어떤 경험보다 더 큰 경쟁력을 가져다 준다는 사실을 믿는 사람 오래 자책하거나 망설이지 않는 사람 타인에게 크게 관여하거나 상관하지 않고 자신에게 집중하는 사람 자신을 누구보다 잘 아는 사람 그리고 그런 자신을 위해 노력하고 변화하며 살아가는 사람 2021. 7. 23.
백준 - 2667.단지번호붙이기 문제 과 같이 정사각형 모양의 지도가 있다. 1은 집이 있는 곳을, 0은 집이 없는 곳을 나타낸다. 철수는 이 지도를 가지고 연결된 집의 모임인 단지를 정의하고, 단지에 번호를 붙이려 한다. 여기서 연결되었다는 것은 어떤 집이 좌우, 혹은 아래위로 다른 집이 있는 경우를 말한다. 대각선상에 집이 있는 경우는 연결된 것이 아니다. 는 을 단지별로 번호를 붙인 것이다. 지도를 입력하여 단지수를 출력하고, 각 단지에 속하는 집의 수를 오름차순으로 정렬하여 출력하는 프로그램을 작성하시오. 입력 첫 번째 줄에는 지도의 크기 N(정사각형이므로 가로와 세로의 크기는 같으며 5≤N≤25)이 입력되고, 그 다음 N줄에는 각각 N개의 자료(0혹은 1)가 입력된다. 출력 첫 번째 줄에는 총 단지수를 출력하시오. 그리고 각 .. 2021. 7. 18.
백준 - 1138.바닥장식 문제 형택이는 건축가이다. 지금 막 형택이는 형택이의 남자 친구 기훈이의 집을 막 완성시켰다. 형택이는 기훈이 방의 바닥 장식을 디자인했고, 이제 몇 개의 나무 판자가 필요한지 궁금해졌다. 나무 판자는 크기 1의 너비를 가졌고, 양수의 길이를 가지고 있다. 기훈이 방은 직사각형 모양이고, 방 안에는 벽과 평행한 모양의 정사각형으로 나누어져 있다. 이제 ‘-’와 ‘|’로 이루어진 바닥 장식 모양이 주어진다. 만약 두 개의 ‘-’가 인접해 있고, 같은 행에 있다면, 두 개는 같은 나무 판자이고, 두 개의 ‘|’가 인접해 있고, 같은 열에 있다면, 두 개는 같은 나무 판자이다. 기훈이의 방 바닥을 장식하는데 필요한 나무 판자의 개수를 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 방 바닥의 세로 크기N과 가.. 2021. 7. 18.
백준 - 1003.피보나치 함수 https://www.acmicpc.net/problem/1003 다음 소스는 N번째 피보나치 수를 구하는 C++ 함수이다. int fibonacci(int n) { if (n == 0) { printf("0"); return 0; } else if (n == 1) { printf("1"); return 1; } else { return fibonacci(n‐1) + fibonacci(n‐2); } } fibonacci(3)을 호출하면 다음과 같은 일이 일어난다. fibonacci(3)은 fibonacci(2)와 fibonacci(1) (첫 번째 호출)을 호출한다. fibonacci(2)는 fibonacci(1) (두 번째 호출)과 fibonacci(0)을 호출한다. 두 번째 호출한 fibonacci(1.. 2021. 7. 4.
Codesignal - buildPalindrome Given a string, find the shortest possible string which can be achieved by adding characters to the end of initial string to make it a palindrome. Example For st = "abcdc", the output should be buildPalindrome(st) = "abcdcba". Input/Output [execution time limit] 20 seconds (swift) [input] string stGuaranteed constraints: 3 ≤ st.length ≤ 10. A string consisting of lowercase English letters. [outp.. 2021. 5. 6.
Codesignal - firstDigit Find the leftmost digit that occurs in a given string. Example For inputString = “var_1__Int”, the output should be firstDigit(inputString) = ‘1’; For inputString = “q2q-q”, the output should be firstDigit(inputString) = ‘2’; For inputString = “0ss”, the output should be firstDigit(inputString) = ‘0’. Input/Output [execution time limit] 20 seconds (swift) [input] string inputString A string cont.. 2021. 5. 6.
Codesignal - find Email Domain An email address such as "John.Smith@example.com" is made up of a local part ("John.Smith"), an "@" symbol, then a domain part ("example.com"). The domain name part of an email address may only consist of letters, digits, hyphens and dots. The local part, however, also allows a lot of different special characters. Here you can look at several examples of correct and incorrect email addresses. Gi.. 2021. 5. 6.
Codesignal - extractEachKth Given array of integers, remove each kth element from it. Example For inputArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and k = 3, the output should be extractEachKth(inputArray, k) = [1, 2, 4, 5, 7, 8, 10]. Input/Output [execution time limit] 20 seconds (swift) [input] array.integer inputArray Guaranteed constraints: 5 ≤ inputArray.length ≤ 15, -20 ≤ inputArray[i] ≤ 20. [input] integer k Guaranteed .. 2021. 5. 3.
Codesignal - evenDigingsOnly Check if all digits of the given integer are even. Example For n = 248622, the output should be evenDigitsOnly(n) = true; For n = 642386, the output should be evenDigitsOnly(n) = false. Input/Output [execution time limit] 20 seconds (swift) [input] integer n Guaranteed constraints: 1 ≤ n ≤ 109. [output] boolean true if all digits of n are even, false otherwise. 풀이 주어지는 숫자의 각 자리수에 해당하는 숫자가 짝수일때만 .. 2021. 5. 3.
300x250