구현

Algorithm/PS

[BOJ/백준] 8714 - Monety [python]

문제 링크 8714번: Monety Pierwszy wiersz wejścia zawiera jedną liczbę całkowitą n (1 ≤ n ≤ 106), oznaczająca liczbę monet Bajtka. Kolejny wiersz zawiera ciąg n liczb całkowitych a1, a2, ..., an, gdzie ai oznacza opis i-tej monety, 0 - jeśli moneta leży na awers www.acmicpc.net 문제 풀이 첫 줄에 n을 입력받고, 두번째 줄에 리스트를 입력받았을 때, 리스트의 합을 m이라 한다면 n-m과 m 중 최솟값을 출력한다. 정답 코드 n = int(input()) m = sum([*map(int, input(..

Algorithm/PS

[BOJ/백준] 8387 - Dyslexia [python]

문제 링크 8387번: Dyslexia In the recent years children in Byteland have been hardly reading any books. This has a negative influence on the knowledge of orthography among Byteland residents. Teachers at schools do their best to change this situation. They organize many different te www.acmicpc.net 문제 풀이 주어진 문자열 두 개를 받아, 같은 위치의 문자가 같은 경우, 정답을 1 증가시킨다. 정답 코드 n = int(input()) s1 = input() s2 = input() ..

Algorithm/PS

[BOJ/백준] 8371 - Dyslexia [python]

문제 링크 8371번: Dyslexia In the recent years children in Byteland have been hardly reading any books. This has a negative influence on the knowledge of orthography among Byteland residents. Teachers at schools do their best to change this situation. They organize many different te www.acmicpc.net 문제 풀이 길이가 같은 두 문자열이 주어졌을 때, 같은 위치의 문자가 다른 경우의 갯수를 출력해준다. 정답 코드 n = int(input()) s1 = input() s2 = input..

Algorithm/PS

[BOJ/백준] 7947 - Koncert [python]

문제 링크 7947번: Koncert Dla każdego zestawu danych wypisz trzy liczby całkowite r, g, b stanowiące opis trzech składowych koloru światła padającego na gwiazdę, będące uśrednieniem światła padającego z reflektorów. Podaj wynik uwzględniając zaokrąglenie matematyc www.acmicpc.net 문제 풀이 이 문제는 테스트 케이스마다 10개의 줄이 들어오는데, 각 줄마다 입력되는 세 값을 r, g, b라고 할 때, 10개의 r, g, b 값의 평균을 구해주는 문제이다. 단, 소숫점 첫째자리에서 반올림해준다. 여..

Algorithm/PS

[BOJ/백준] 7782 - Alien [python]

문제 링크 7782번: Alien Once upon a time after winning another competition at KBTU, Bakhytzhan, Askar and Artem walked throw the Old Square. When they found some interesting rectangle lines on the asphalt, they stopped and screamed out ”R tree”. They screamed so loud that all www.acmicpc.net 문제 풀이 두 번째 줄의 입력값을 받아, 그 다음 줄부터의 입력 중 두 번째 줄의 입력값이 포함된다면 "Yes", 아니라면 "No"를 출력한다. 정답 코드 n = int(input()) b1, b2..

Algorithm/PS

[BOJ/백준] 6975 - Deficient, Perfect, and Abundant [python]

문제 링크 6975번: Deficient, Perfect, and Abundant Write a program that repeatedly reads a positive integer, determines if the integer is deficient, perfect, or abundant, and outputs the number along with its classification. A positive integer, n, is said to be perfect if the sum of its proper diviso www.acmicpc.net 문제 풀이 주어진 입력값을 조건에 따라 출력해준다. 먼저, 입력값으로 자기 자신을 제외한 약수의 리스트를 구해준다. 약수 리스트의 합이 입력값보다 작으면..

Algorithm/PS

[BOJ/백준] 6903 - Trident [python]

문제 링크 6903번: Trident A trident is a fork with three tines (prongs). A simple picture of a trident can be made from asterisks and spaces: * * * * * * * * * ******* * * * * In this example, each tine is a vertical column of 3 asterisks. Each tine is separated by 2 spaces. The ha www.acmicpc.net 문제 풀이 삼지창을 출력하는 문제이다. "*"을 주어진 간격에 맞추어 찍어준다. 정답 링크 t = int(input()) s = int(input()) h = int(input()) fo..

Algorithm/PS

[BOJ/백준] 6889 - Smile with Similes [python]

문제 링크 6889번: Smile with Similes A simile is a combination of an adjective and noun that produces a phrase such as "Easy as pie" or "Cold as ice". Write a program to input $n$ adjectives $(1 \le n \le 5)$ and $m$ nouns $(1 \le m \le 5)$, and print out all possible similes. The first two l www.acmicpc.net 문제 풀이 이 문제는 입력값을 두 개의 리스트에 담아 각각의 조합을 출력해주는 문제이다. 정답 코드 n = int(input()) m = int(input()) lst..

chanwoong1
'구현' 태그의 글 목록 (5 Page)