분류 전체보기
-
[python]백준 Zegarek 26752번알고리즘 문제풀이/백준(파이썬) 2023. 6. 15. 23:19
코드 import sys sys.stdin = open("26752.txt", "r") a,b,c=map(int,input().split()) s=a*3600 + b*60 + c+1 a=str(s//3600%24) b=str(s%3600//60) c=str(s%60) print(f"{a.zfill(2)}:{b.zfill(2)}:{c.zfill(2)}") 링크 https://www.acmicpc.net/problem/26752 26752번: Zegarek W pierwszym wierszu wejścia znajdują się trzy liczby naturalne H, M oraz S (0 ≤ H ≤ 23, 0 ≤ M, S ≤ 59) pooddzielane pojedynczymi odstępami i b..
-
[python]백준 末尾の文字 (Last Letter) 27541번알고리즘 문제풀이/백준(파이썬) 2023. 6. 13. 23:41
코드 import sys sys.stdin = open("27541.txt", "r") q=int(input()) w=input() if w[q-1]!="G": print(w+"G") else: print(w[:q-1]) 링크 https://www.acmicpc.net/problem/27541 27541번: 末尾の文字 (Last Letter) 葵が見た文字列 JOI の末尾の文字は G でないので,葵は末尾に文字 G を付け加えた文字列 JOIG を思い浮かべる.そのため,JOIG を出力する. www.acmicpc.net
-
[python]백준 Final Price 28224번알고리즘 문제풀이/백준(파이썬) 2023. 6. 12. 23:38
코드 import sys sys.stdin = open("28224.txt", "r") t=int(input()) s=0 for i in range(t): s+=int(input()) print(s) 링크 https://www.acmicpc.net/problem/28224 28224번: Final Price The first input line contains an integer n (1 ⩽ n ⩽ 1000), indicating the number of days the prices are observed. The second line contains a positive integer indicating the initial price of the desired good on day 1. The next..
-
[python]백준 달달함이 넘쳐흘러 17256번알고리즘 문제풀이/백준(파이썬) 2023. 6. 11. 23:59
코드 import sys sys.stdin = open("17256.txt", "r") a=list(input().split()) b=list(input().split()) print(int(b[0])-int(a[2]),int(b[1])//int(a[1]),int(b[2])-int(a[0])) 링크 https://www.acmicpc.net/problem/17256 17256번: 달달함이 넘쳐흘러 첫째 줄에 케이크 수 a를 구성하는 자연수 a.x, a.y, a.z 가 차례대로 주어진다. (1 ≤ a.x, a.y, a.z ≤ 100) 둘째 줄에 케이크 수 c를 구성하는 자연수 c.x, c.y, c.z 가 차례대로 주어진다. (1 ≤ c.x, c.y, c.z www.acmicpc.net
-
[java]백준 치킨댄스를 추는 곰곰이를 본 임스 25191번알고리즘 문제풀이/백준(자바) 2023. 6. 10. 23:57
코드 import java.util.Scanner; public class BOJ_25191 { public static void main(String[] args) { Scanner in =new Scanner(System.in); int n =in.nextInt(); int a =in.nextInt(); int b =in.nextInt(); System.out.println(Math.min(n, a/2+b)); in.close(); } } 링크 https://www.acmicpc.net/problem/25191 25191번: 치킨댄스를 추는 곰곰이를 본 임스 콜라 $4$개, 맥주 $2$개로 치킨을 $4$마리까지 먹을 수 있지만, 치킨집에 치킨이 $3$마리밖에 없으므로 임스도 $3$마리까지만 먹을 수 ..
-
[python]백준 파일 옮기기 11943번알고리즘 문제풀이/백준(파이썬) 2023. 6. 10. 23:57
코드 import sys sys.stdin = open("11943.txt", "r") a,b=map(int,input().split()) c,d=map(int,input().split()) print(min(a+d,c+b)) 링크 https://www.acmicpc.net/problem/11943 11943번: 파일 옮기기 첫 번째 줄에는 첫 번째 바구니에 있는 사과와 오렌지의 수 A, B가 주어진다. (0 ≤ A, B ≤ 1,000) 두 번째 줄에는 두 번째 바구니에 있는 사과와 오렌지의 수 C, D가 주어진다. (0 ≤ C, D ≤ 1,000) www.acmicpc.net