본문 바로가기

컴퓨터과학/Algorithm

(21)
[Python] [백준] 1076번 저항 문제 1076번: 저항 전자 제품에는 저항이 들어간다. 저항은 색 3개를 이용해서 그 저항이 몇 옴인지 나타낸다. 처음 색 2개는 저항의 값이고, 마지막 색은 곱해야 하는 값이다. 저항의 값은 다음 표를 이용해서 구한 www.acmicpc.net 코드 color = ['black', 'brown', 'red', 'orange', 'yellow', 'green', 'blue', 'violet', 'grey', 'white'] a = int(color.index(input())) b = int(color.index(input())) c = int(color.index(input())) print((a*10+b)*(10**c)) 설명 입력으로 저항의 색 세 개가 차례로 주어진다. 딕셔너리로 색과 값을 연결지을..
[SQL] [Codewars] 7Kyu - SQL with LOTR: Elven Wildcards 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 문제 Deep within the fair realm of Lothlórien, you have been asked to create a shortlist of candidates for a recently vacated position on the council. Of so many wo..
[Common Lisp] [Codewars] 8Kyu - Grasshopper - Summation 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 program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0. For example: summation(2) ..
[SQL] [Codewars] 7Kyu - Countries Capitals for Trivia Night (SQL for Beginners #6) 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 문제 Your friends told you that if you keep coding on your computer, you are going to hurt your eyes. They suggested that you go with them to trivia night at the lo..
[Common Lisp] [구름LEVEL] 16진수 구름LEVEL 코딩테스트에서 가장 높은 비중을 차지하는 알고리즘 문제를 제작하고 풀이할 수 있는 온라인 저지 서비스입니다. 기업에서 선호하는 C, C++, 파이썬(Python), 자바(Java), 자바스크립트(Javascript) 이 level.goorm.io 문제 입력 받은 10진수를 16진수로 출력하는 프로그램을 작성하십시오. 코드 (setq n (format nil "~X" (read))) (write-string (string-downcase n)) 설명 아래와 같이 간단하게 풀려고 했으나, (write-string (format nil "~X" (read))) 16진수의 소문자 출력을 요구하기에, 구한 16진수를 그냥 소문자 처리 해버렸다. 조금 찜찜하지만, 일단 여기까지.