ALGORITHM ๐Ÿค–

์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต / ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„
https://www.acmicpc.net/problem/1026 1026๋ฒˆ: ๋ณด๋ฌผ ์ฒซ์งธ ์ค„์— N์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„์—๋Š” A์— ์žˆ๋Š” N๊ฐœ์˜ ์ˆ˜๊ฐ€ ์ˆœ์„œ๋Œ€๋กœ ์ฃผ์–ด์ง€๊ณ , ์…‹์งธ ์ค„์—๋Š” B์— ์žˆ๋Š” ์ˆ˜๊ฐ€ ์ˆœ์„œ๋Œ€๋กœ ์ฃผ์–ด์ง„๋‹ค. N์€ 50๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์ž์—ฐ์ˆ˜์ด๊ณ , A์™€ B์˜ ๊ฐ ์›์†Œ๋Š” 100๋ณด๋‹ค ์ž‘๊ฑฐ www.acmicpc.net import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr1 = new int[n]; int[] arr2 = new int[n]..
https://www.acmicpc.net/problem/10872 10872๋ฒˆ: ํŒฉํ† ๋ฆฌ์–ผ 0๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™์€ ์ •์ˆ˜ N์ด ์ฃผ์–ด์ง„๋‹ค. ์ด๋•Œ, N!์„ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. 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 answer = 1; for (int i = 1; i
https://www.acmicpc.net/problem/2558 2558๋ฒˆ: A+B - 2 ์ฒซ์งธ ์ค„์— A, ๋‘˜์งธ ์ค„์— B๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. (0 < A, B < 10) 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(); System.out.println(a+b); } }
https://www.acmicpc.net/problem/10718 10718๋ฒˆ: We love kriii ACM-ICPC ์ธํ„ฐ๋„ท ์˜ˆ์„ , Regional, ๊ทธ๋ฆฌ๊ณ  World Finals๊นŒ์ง€ ์ด๋ฏธ 2ํšŒ์”ฉ ์ง„์ถœํ•ด๋ฒ„๋ฆฐ kriii๋Š” ๋ฏธ๋ จ์„ ๋ฒ„๋ฆฌ์ง€ ๋ชปํ•˜๊ณ  ์™ ์ง€ ๋ชจ๋ฅด๊ฒŒ ์˜ฌํ•ด์—๋„ ํŒŒ์ฃผ World Finals ์ค€๋น„ ์บ ํ”„์— ์ฐธ์—ฌํ–ˆ๋‹ค. ๋Œ€ํšŒ๋ฅผ ๋œฐ ์ค„ ๋ชจ๋ฅด๋Š” ์ง€๋ฐ• www.acmicpc.net public class Main { public static void main(String[] args) { System.out.println("๊ฐ•ํ•œ์นœ๊ตฌ ๋Œ€ํ•œ์œก๊ตฐ"); System.out.println("๊ฐ•ํ•œ์นœ๊ตฌ ๋Œ€ํ•œ์œก๊ตฐ"); } }
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://school.programmers.co.kr/learn/courses/30/lessons/12917 class Solution { public String solution(String s) { String answer = ""; char [] arr = s.toCharArray(); char temp; for (int i = 0; i < arr.length - 1; i++){ for(int j = i + 1; j < arr.length; j++){ if(arr[i] < arr[j]){ temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } } } for(int i = 0; i < arr.length; i++){ answer += arr[i]; } return..
daxx0ne
'ALGORITHM ๐Ÿค–' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (10 Page)