분류 전체보기73 [백준 2740] 행렬 곱셈 - Python(파이썬) import sys N, M = map(int, sys.stdin.readline().split()) arr1, arr2 = [], [] for _ in range(N): arr1.append(list(map(int, sys.stdin.readline().split()))) A, B = map(int, sys.stdin.readline().split()) for _ in range(A): arr2.append(list(map(int, sys.stdin.readline().split()))) result = [[0] * B for _ in range(N)] for n in range(N): # 0 1 2 for m in range(B): # 0 1 2 for a in range(A): # 0 1 resul.. 2021. 3. 4. [백준 1629] 곱셈 - Python(파이썬) import sys def solution(x, y): if y == 1: return x % C else: result = solution(x, y // 2) if y % 2: return result * result * x % C else: return result * result % C A, B, C = map(int, sys.stdin.readline().split()) print(pow(A, B, C)) print(solution(A, B)) 2021. 3. 4. [HacKerRank SQL] Ollivander's Inventory - MYSQL Input Format The following tables contain data on the wands in Ollivander's inventory: Wands: Wands_Property: 'code'와 'age'는 1:1 대응 관계, 즉 (code, age) 쌍은 다른 쌍과 중복되지 않음 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 .. 2021. 2. 25. [HacKerRank SQL] Top Competitors - MYSQL Input Format The following tables contain contest data: Hackers: Difficulty: Challenges: Submissions: Julia just finished conducting a coding contest, and she needs your help assembling the leaderboard! Write a query to print the respective hacker_id and name of hackers who achieved full scores for more than one challenge. Order your output in descending order by the total number of challenges i.. 2021. 2. 24. [HacKerRank SQL] The Report - MYSQL 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 -- i.e. higher grades are entered first. If there is more than one student with the same grade (8-10) assigned to them, order those particular students by their name alphabetic.. 2021. 2. 24. [HacKerRank SQL] Asian Population- MYSQL Note: CITY.CountryCode and COUNTRY.Code are matching key columns. Input Format The CITY and COUNTRY tables are described as follows: Given the CITY and COUNTRY tables, query the sum of the populations of all cities where the CONTINENT is 'Asia'. SELECT SUM(A.POPULATION) FROM CITY AS A INNER JOIN COUNTRY AS B ON A.COUNTRYCODE = B.CODE WHERE B.CONTINENT = 'Asia'; Given the CITY and COUNTRY tables,.. 2021. 2. 24. 이전 1 ··· 6 7 8 9 10 11 12 13 다음