ALGORITHM ๐Ÿค–

์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต / ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„
https://www.acmicpc.net/problem/1009 1009๋ฒˆ: ๋ถ„์‚ฐ์ฒ˜๋ฆฌ ์ž…๋ ฅ์˜ ์ฒซ ์ค„์—๋Š” ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค์˜ ๊ฐœ์ˆ˜ T๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๊ทธ ๋‹ค์Œ ์ค„๋ถ€ํ„ฐ ๊ฐ๊ฐ์˜ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค์— ๋Œ€ํ•ด ์ •์ˆ˜ a์™€ b๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. (1 ≤ a < 100, 1 ≤ b < 1,000,000) www.acmicpc.net import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++) { int a = sc.nextInt(); int b = sc.nextInt(); int num = 1; fo..
https://www.acmicpc.net/problem/11501 11501๋ฒˆ: ์ฃผ์‹ ์ž…๋ ฅ์˜ ์ฒซ ์ค„์—๋Š” ํ…Œ์ŠคํŠธ์ผ€์ด์Šค ์ˆ˜๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ž์—ฐ์ˆ˜ T๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๊ฐ ํ…Œ์ŠคํŠธ์ผ€์ด์Šค ๋ณ„๋กœ ์ฒซ ์ค„์—๋Š” ๋‚ ์˜ ์ˆ˜๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ž์—ฐ์ˆ˜ N(2 ≤ N ≤ 1,000,000)์ด ์ฃผ์–ด์ง€๊ณ , ๋‘˜์งธ ์ค„์—๋Š” ๋‚  ๋ณ„ ์ฃผ๊ฐ€๋ฅผ ๋‚˜ํƒ€ www.acmicpc.net import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++) { int n = sc.nextInt(); long[] arr = new long[n]..
https://school.programmers.co.kr/learn/courses/30/lessons/17681 class Solution { public String[] solution(int n, int[] arr1, int[] arr2) { String[] answer = new String[n]; for(int i = 0; i ๊ณต๋ฐฑ' ๋ณ€ํ™˜ answer[i] = answer[i].replace("1", "#"); // '1 -> #'' ๋ณ€ํ™˜ while (answer[i]...
https://www.acmicpc.net/problem/2750 2750๋ฒˆ: ์ˆ˜ ์ •๋ ฌํ•˜๊ธฐ ์ฒซ์งธ ์ค„์— ์ˆ˜์˜ ๊ฐœ์ˆ˜ N(1 ≤ N ≤ 1,000)์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„๋ถ€ํ„ฐ N๊ฐœ์˜ ์ค„์—๋Š” ์ˆ˜๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ด ์ˆ˜๋Š” ์ ˆ๋Œ“๊ฐ’์ด 1,000๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์ •์ˆ˜์ด๋‹ค. ์ˆ˜๋Š” ์ค‘๋ณต๋˜์ง€ ์•Š๋Š”๋‹ค. www.acmicpc.net import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[n]; for(int i = 0; i < n; i++){ int num = sc.nextInt(); arr[i] = nu..
https://www.acmicpc.net/problem/11727 11727๋ฒˆ: 2×n ํƒ€์ผ๋ง 2 2×n ์ง์‚ฌ๊ฐํ˜•์„ 1×2, 2×1๊ณผ 2×2 ํƒ€์ผ๋กœ ์ฑ„์šฐ๋Š” ๋ฐฉ๋ฒ•์˜ ์ˆ˜๋ฅผ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. ์•„๋ž˜ ๊ทธ๋ฆผ์€ 2×17 ์ง์‚ฌ๊ฐํ˜•์„ ์ฑ„์šด ํ•œ๊ฐ€์ง€ ์˜ˆ์ด๋‹ค. www.acmicpc.net import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] dp = new int[n + 1]; ..
https://school.programmers.co.kr/learn/courses/30/lessons/68935 class Solution { public int solution(int n) { int answer = 0; String temp = Integer.toString(n, 3); // 10์ง„๋ฒ• -> 3์ง„๋ฒ• String reverse = ""; for (int i = temp.length() - 1; i >= 0; i--) { // 3์ง„๋ฒ• ์ƒ์—์„œ ์•ž๋’ค ๋ฐ˜์ „ reverse = reverse + temp.charAt(i); } answer = Integer.parseInt(reverse, 3); // ๋ฐ˜์ „ํ•œ 3์ง„๋ฒ• -> 10์ง„๋ฒ• return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/120899 class Solution { public int[] solution(int[] array) { int[] answer = new int[2]; for(int i = 0; i < array.length; i++){ if(answer[0] < array[i]){ answer[0] = array[i]; answer[1] = i; } } return answer; } }
daxx0ne
'ALGORITHM ๐Ÿค–' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (5 Page)