Home
Justnote
Cancel

[Python] 백준 2884번 : 알람 시계

Problem https://www.acmicpc.net/problem/2884 Solution h,m = map(int, input().split()) if m>=45: print(h,m-45) else: if h!=0: print(h-1,m+15) else: print(23,m+15) Me...

[Python] 백준 10871번 : X보다 작은 수

Problem https://www.acmicpc.net/problem/10871 Solution code1 list = input().split() n = int(list[0]) x = int(list[1]) c = [] a = input().split() for i in a: if int(i)<x: c.append(i...

[Python] 백준 11726번 : 2×n 타일링

Problem https://www.acmicpc.net/problem/11726 Solution import math sol=0 x = int(input()) for n in range(0,x+1): while (x-n)%2==0: y = (x-n)//2 sol += math.factorial(n+y)//(ma...

[Python] 백준 8393번 : 합

Problem https://www.acmicpc.net/problem/8393 Solution code1 n = int(input()) sum = 0 def fsum(): global sum for i in range(n+1): sum+=i return sum print(fsum()) for루프를 도는 함수를...

[Python][Java] 백준 10998번 : AxB

Problem https://www.acmicpc.net/problem/10998 Solution code1(python) a, b = input().split() a = int(a) b = int(b) print(a*b) code2(python) a, b = map(int,input().split()) print(a*b) code3(java...

[Java] 백준 1000번 : A+B

Problem https://www.acmicpc.net/problem/1000 Solution import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = sc...

[Python] 백준 10430번 : 나머지

Problem https://www.acmicpc.net/problem/10430 Solution input을 통해 문자열을 입력받은 후 split함수를 사용해서 list형태로 변환했다. str형인 A, B, C 각각을 int형으로 변환한 후 계산하여 출력. code A, B, C = input().split() A = int(A) B = int(...

[Python] 백준 1920번 : 수 찾기

Problem https://www.acmicpc.net/problem/1920 Solution 오답 코드 1 def binary(a, b): left , right = 0, y - 1 while left <= right: middle = (left + right) // 2 if b == a[midd...

[Python] 백준 2750번 : 수 정렬하기

Problem https://www.acmicpc.net/problem/2750 Solution 정답 코드1 N = int(input()) numbers = [] for i in range(N) : numbers.append(int(input())) for i in range(1, len(numbers)) : while (i&gt...

[Python] 백준 2438번 : 별 찍기 - 1

Problem https://www.acmicpc.net/problem/2438 Solution n = int(input()) for i in range(n): i += 1 print("*" * i)