목록YJ (375)
코딩로그

[문제] 접미사 배열은 문자열 S의 모든 접미사를 사전순으로 정렬해 놓은 배열이다. baekjoon의 접미사는 baekjoon, aekjoon, ekjoon, kjoon, joon, oon, on, n 으로 총 8가지가 있고, 이를 사전순으로 정렬하면, aekjoon, baekjoon, ekjoon, joon, kjoon, n, on, oon이 된다. 문자열 S가 주어졌을 때, 모든 접미사를 사전순으로 정렬한 다음 출력하는 프로그램을 작성하시오. [입력] 첫째 줄에 문자열 S가 주어진다. S는 알파벳 소문자로만 이루어져 있고, 길이는 1,000보다 작거나 같다. [출력] 첫째 줄부터 S의 접미사를 사전순으로 한 줄에 하나씩 출력한다. [Source Code] #include #include #includ..

[문제] 드높은 남산 위에 우뚝 선 송백은 흰 눈빛에 푸르고 옛부터 흘러가는 한가람 장 할 손 우리 학원 이룩한 굳세고 다함 없는 거룩한 뜻이 백이십년 빛난 역사 자랑이로세 비바람 몰아쳐도 나가자 공들여 쌓은 탑은 빛난다 울려라 삼천리에 힘차게 세워라 반석 위에 선린의터를 선린인터넷고등학교 학생들은 이미 잘 알고 있겠지만, 학교 교가를 부를 때는 마지막 5글자인 "선린의터를" 부분만 크고 우렁차게 불러야 한다. 정휘는 여기에 영감을 받아, 문자열이 주어지면 마지막 5글자만 우렁차게 읽으려고 한다. 공백이 없는 문자열이 주어지면 마지막 5글자만 출력하는 프로그램을 작성해보자. [입력] 첫 번째 줄에 문자열의 길이 $N$이 주어진다. 두 번째 줄에는 $N$글자로 이루어진 문자열 $S$가 주어진다. [출력] ..

[문제] If you remember the preliminary round, we already measured distances in Manhattan. Besides being a grid, Manhattan also has very tall buildings scattered all over the island. Suppose I want to go to from my apartment that is at position x=3, y=4, floor=3 to my friends apartment, which is x=3, y=5, floor=2. To compute the distance between two points we have to take into account the distance ..

[문제] Back in the old days before the creation of the mighty Centauri Republic, the planet Centauri Prime was split into several independent kingdoms. The kingdom of Mollaristan was ruled by king Loatold, while the kingdom of Auritania was under the rule of queen Elana. In fact, it just so happened that every kingdom whose name ended in a consonant was ruled by a king, while every kingdom whose n..

[문제] Back in the old days before the creation of the mighty Centauri Republic, the planet Centauri Prime was split into several independent kingdoms. The kingdom of Mollaristan was ruled by king Loatold, while the kingdom of Auritania was under the rule of queen Elana. In fact, it just so happened that every kingdom whose name ended in a consonant was ruled by a king, while every kingdom whose n..

[문제] Uniform Resource Identifiers (or URIs) are strings like http://icpc.baylor.edu/icpc/, mailto:foo@bar.org, ftp://127.0.0.1/pub/linux, or even just readme.txt that are used to identify a resource, usually on the Internet or a local computer. Certain characters are reserved within URIs, and if a reserved character is part of an identifier then it must be percent-encoded by replacing it with a ..

[문제] Angela is teaching her primary school pupils how to use a protractor (which hopefully you know is a device used to measure angles!). She has given each pupil a set of triangles and asked them to measure and record each of the three internal angles. Angela would like you to write a simple program to check her pupil s results. Knowing that the internal angles of a triangle add up to 180º, whi..

[문제] Let’s face it... you are not that handy. When you need to make a major home repair, you often need to hire someone to help. When they come for the first visit, they make an estimate of the cost. Here they must be careful: if they overestimate the cost, it might scare you off, but if they underestimate, the work might not be worth their time. Because the worker is so careful, it can take a l..