문제 풀이

    [baekjoon 2749] 피보나치 수 3 (DP, 피사노 주기) (C++)

    www.acmicpc.net/problem/2749 2749번: 피보나치 수 3 첫째 줄에 n이 주어진다. n은 1,000,000,000,000,000,000보다 작거나 같은 자연수이다. www.acmicpc.net 평범한 피보나치 수를 구하는 문제인 것 같지만 주어지는 수의 범위가 10^18이다. 따라서 저만큼의 크기를 갖는 DP 배열을 생성하는 것은 불가능하기에 다른 방법을 이용해야 한다. 피보나치 수를 일정한 크기의 수로 나눈 나머지는 파사노 주기라고 하는 주기를 갖는다고 한다. 주기를 갖게 되면 N을 구하더라도 N%P(주기)와 같은 값을 갖게 된다. www.acmicpc.net/blog/view/28 피보나치 수를 구하는 여러가지 방법 피보나치 수는 다음과 같이 정의되는 수열입니다. $F_0 = ..

    [Hackerrank SQL] Ollivander's Inventory

    www.hackerrank.com/challenges/harry-potter-and-wands/problem Ollivander's Inventory | HackerRank Help pick out Ron's new wand. www.hackerrank.com Harry Potter and his friends are at Ollivander's with Ron, finally replacing Charlie's old broken wand. Hermione decides the best way to choose is by determining the minimum number of gold galleons needed to buy each non-evil wand of high power and age..

    [Hackerrank SQL] The Report

    www.hackerrank.com/challenges/the-report/problem The Report | HackerRank Write a query to generate a report containing three columns: Name, Grade and Mark. www.hackerrank.com Ketty gives Eve a task to generate a report containing three columns: Name, Grade and Mark. Ketty doesn't want the NAMES of those students who received a grade lower than 8. The report must be in descending order by grade -..

    [Hackerrank SQL] Average Population of Each Continent

    www.hackerrank.com/challenges/average-population-of-each-continent/problem Average Population of Each Continent | HackerRank Query the names of all continents and their respective city populations, rounded down to the nearest integer. www.hackerrank.com Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY..

    [Hackerrank SQL] Type of Triangle

    www.hackerrank.com/challenges/what-type-of-triangle/problem Type of Triangle | HackerRank Query a triangle's type based on its side lengths. www.hackerrank.com Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the following statements for each record in the table: Equilateral: It's a triangle with sides of equal length. Isosceles..

    [Hackerrank SQL] Weather Observation Station 13

    www.hackerrank.com/challenges/weather-observation-station-13/problem Weather Observation Station 13 | HackerRank Query the sum of Northern Latitudes having values greater than 38.7880 and less than 137.2345, truncated to 4 decimal places. www.hackerrank.com 연산에 관한 문제이다. select truncate(sum(LAT_N),4) from STATION WHERE LAT_N > 38.7880 AND lat_n