[백준 알고리즘] 10952번 A+B - 5(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 18:02[백준 알고리즘] 10952번 A+B - 5(Python3, Java)

import sys while(1): line = sys.stdin.readline() a, b = line.split() if a == '0' and b == '0': break print(int(a)+int(b)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while(true){ String[] line = ..

[백준 알고리즘] 11022번  A+B - 8(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:53[백준 알고리즘] 11022번 A+B - 8(Python3, Java)

import sys n = int(sys.stdin.readline()) for i in range(1, n+1): line = sys.stdin.readline() a, b = line.split() print("Case #%d: %d + %d = %d" %(i, int(a), int(b), int(a)+int(b))) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_11022 { public static void main(String[] args) throws IOException { Buffere..

[백준 알고리즘] 11021번  A+B - 7(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:47[백준 알고리즘] 11021번 A+B - 7(Python3, Java)

import sys n = int(sys.stdin.readline()) for i in range(1, n+1): line = sys.stdin.readline() a, b = line.split() print("Case #%d: %d" %(i,int(a)+int(b))) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_11021 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedRe..

[백준 알고리즘] 1552번 빠른 A+B(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:31[백준 알고리즘] 1552번 빠른 A+B(Python3, Java)

import sys n = sys.stdin.readline() n= int(n) for i in range(n): line= sys.stdin.readline() a,b = line.split() print(int(a)+int(b)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_15552 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamRe..

[백준 알고리즘] 10950번 A+B-3 (Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:20[백준 알고리즘] 10950번 A+B-3 (Python3, Java)

n = int(input()) for i in range(n): a,b = input().split() print(int(a)+int(b)) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_10950 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLin..

[백준 알고리즘] 2884번 알람 시계(Python3, Java)
언어, 알고리즘 공부/백준2020. 2. 11. 17:10[백준 알고리즘] 2884번 알람 시계(Python3, Java)

h, m = input().split() h, m = int(h), int(m) if m0: h -= 1 else: #h==0인경우 h = 23 m = 60-(45-m) else: m = m-45 print(h, m) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class b_2884 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System..

[백준알고리즘] 2753번 윤년(Python3, Java)
카테고리 없음2020. 2. 11. 17:01[백준알고리즘] 2753번 윤년(Python3, Java)

year = int(input()) if (year%4 == 0 and year%100 != 0) or year%400 ==0: print(1) else: print(0) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int year = Integer.parseInt(br.readLine()); if(((year%4..

[백준 알고리즘] 1330번 두 수 비교하기(Python3)
언어, 알고리즘 공부/백준2020. 2. 11. 16:52[백준 알고리즘] 1330번 두 수 비교하기(Python3)

a, b = input().split() if int(a) > int(b): print('>') elif int(a)

[백준 알고리즘] 2750번 수 정렬하기(Python3)
언어, 알고리즘 공부/백준2020. 2. 11. 16:14[백준 알고리즘] 2750번 수 정렬하기(Python3)

n = int(input()) #n개의 숫자 a = list() for i in range(n): a.append(int(input())) a.sort() for i in range(len(a)): print(a[i]) 링크 https://www.acmicpc.net/problem/2750

선택정렬(Selection Sort)- java, python
전공 이론 공부/알고리즘&자료구조2020. 1. 8. 14:17선택정렬(Selection Sort)- java, python

가장 작은 요소를 골라 맨 앞으로 보내자! 🦋 핵심 장점: 데이터 양이 적을 때 성능이 좋음 작은 값을 선택하기 위해서 비교는 여러번 수행되지만 교환횟수가 적음 단점: 100개 이상의 자료에 대해서는 속도가 급격히 떨어짐 시간복잡도: 0(n^2) 과정 (오름차순으로 정렬한다고 가정) 1. 주어진 리스트에서 최솟값을 찾음 2. 최솟값을 맨 처음 위치한 값과 swap 3. 맨 처음 위치를 뺀 나머지 리스트를 같은 방법으로 반복함 그림으로 쉽게 이해하기 public class A01_selection_sort { public static void main(String[] args) { int[] a = {5,9,2,4,15,6,1,20,3,10,14,0}; //임의로 넣음! //루프를 돌면서 최솟값을 찾고 기..

image