ALGORITHM ๐Ÿค–/Baekjoon

๋ฐฑ์ค€
https://www.acmicpc.net/problem/2748 2748๋ฒˆ: ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜ 2 ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜๋Š” 0๊ณผ 1๋กœ ์‹œ์ž‘ํ•œ๋‹ค. 0๋ฒˆ์งธ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜๋Š” 0์ด๊ณ , 1๋ฒˆ์งธ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜๋Š” 1์ด๋‹ค. ๊ทธ ๋‹ค์Œ 2๋ฒˆ์งธ ๋ถ€ํ„ฐ๋Š” ๋ฐ”๋กœ ์•ž ๋‘ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์˜ ํ•ฉ์ด ๋œ๋‹ค. ์ด๋ฅผ ์‹์œผ๋กœ ์จ๋ณด๋ฉด Fn = Fn-1 + Fn-2 (n ≥ 2)๊ฐ€ www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long num1 = 0; long num2 = 1; for (int i = 0; i < n; i++)..
https://www.acmicpc.net/problem/2747 2747๋ฒˆ: ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜๋Š” 0๊ณผ 1๋กœ ์‹œ์ž‘ํ•œ๋‹ค. 0๋ฒˆ์งธ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜๋Š” 0์ด๊ณ , 1๋ฒˆ์งธ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜๋Š” 1์ด๋‹ค. ๊ทธ ๋‹ค์Œ 2๋ฒˆ์งธ ๋ถ€ํ„ฐ๋Š” ๋ฐ”๋กœ ์•ž ๋‘ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์˜ ํ•ฉ์ด ๋œ๋‹ค. ์ด๋ฅผ ์‹์œผ๋กœ ์จ๋ณด๋ฉด Fn = Fn-1 + Fn-2 (n ≥ 2)๊ฐ€ www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int num1 = 0; int num2 = 1; for (int i = 0; i < n; i++) { i..
https://www.acmicpc.net/problem/25083 25083๋ฒˆ: ์ƒˆ์‹น ์•„๋ž˜ ์˜ˆ์ œ์™€ ๊ฐ™์ด ์ƒˆ์‹น์„ ์ถœ๋ ฅํ•˜์‹œ์˜ค. www.acmicpc.net public class Main { public static void main(String[] args) { System.out.println(" ,r'\"7"); System.out.println("r`-_ ,' ,/"); System.out.println(" \\. \". L_r'"); System.out.println(" `~\\/"); System.out.println(" |"); System.out.println(" |"); } }
https://www.acmicpc.net/problem/11022 11022๋ฒˆ: A+B - 8 ๊ฐ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋งˆ๋‹ค "Case #x: A + B = C" ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•œ๋‹ค. x๋Š” ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ๋ฒˆํ˜ธ์ด๊ณ  1๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋ฉฐ, C๋Š” A+B์ด๋‹ค. www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 1; i
https://www.acmicpc.net/problem/15552 15552๋ฒˆ: ๋น ๋ฅธ A+B ์ฒซ ์ค„์— ํ…Œ์ŠคํŠธ์ผ€์ด์Šค์˜ ๊ฐœ์ˆ˜ T๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. T๋Š” ์ตœ๋Œ€ 1,000,000์ด๋‹ค. ๋‹ค์Œ T์ค„์—๋Š” ๊ฐ๊ฐ ๋‘ ์ •์ˆ˜ A์™€ B๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. A์™€ B๋Š” 1 ์ด์ƒ, 1,000 ์ดํ•˜์ด๋‹ค. www.acmicpc.net import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new Buf..
https://www.acmicpc.net/problem/11021 11021๋ฒˆ: A+B - 7 ๊ฐ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋งˆ๋‹ค "Case #x: "๋ฅผ ์ถœ๋ ฅํ•œ ๋‹ค์Œ, A+B๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ๋ฒˆํ˜ธ๋Š” 1๋ถ€ํ„ฐ ์‹œ์ž‘ํ•œ๋‹ค. www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int[] arr = new int[t]; // t๋งŒํผ ๋ฐฐ์—ด์˜ ํฌ๊ธฐ๋ฅผ ์ง€์ • int i = 0; while (i < t) { // t๋งŒํผ ๋ฐ˜๋ณต int a = sc.nextInt(); int b = sc.next..
https://www.acmicpc.net/problem/2475 2475๋ฒˆ: ๊ฒ€์ฆ์ˆ˜ ์ปดํ“จํ„ฐ๋ฅผ ์ œ์กฐํ•˜๋Š” ํšŒ์‚ฌ์ธ KOI ์ „์ž์—์„œ๋Š” ์ œ์กฐํ•˜๋Š” ์ปดํ“จํ„ฐ๋งˆ๋‹ค 6์ž๋ฆฌ์˜ ๊ณ ์œ ๋ฒˆํ˜ธ๋ฅผ ๋งค๊ธด๋‹ค. ๊ณ ์œ ๋ฒˆํ˜ธ์˜ ์ฒ˜์Œ 5์ž๋ฆฌ์—๋Š” 00000๋ถ€ํ„ฐ 99999๊นŒ์ง€์˜ ์ˆ˜ ์ค‘ ํ•˜๋‚˜๊ฐ€ ์ฃผ์–ด์ง€๋ฉฐ 6๋ฒˆ์งธ ์ž๋ฆฌ์—๋Š” ๊ฒ€์ฆ์ˆ˜๊ฐ€ ๋“ค www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); int e = sc..
daxx0ne
'ALGORITHM ๐Ÿค–/Baekjoon' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (7 Page)