ALGORITHM ๐Ÿค–

์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต / ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„
https://www.acmicpc.net/problem/10871 10871๋ฒˆ: X๋ณด๋‹ค ์ž‘์€ ์ˆ˜ ์ฒซ์งธ ์ค„์— N๊ณผ X๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. (1 ≤ N, X ≤ 10,000) ๋‘˜์งธ ์ค„์— ์ˆ˜์—ด A๋ฅผ ์ด๋ฃจ๋Š” ์ •์ˆ˜ N๊ฐœ๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ฃผ์–ด์ง€๋Š” ์ •์ˆ˜๋Š” ๋ชจ๋‘ 1๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™๊ณ , 10,000๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์ •์ˆ˜์ด๋‹ค. 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 x = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i..
https://www.acmicpc.net/problem/10807 10807๋ฒˆ: ๊ฐœ์ˆ˜ ์„ธ๊ธฐ ์ฒซ์งธ ์ค„์— ์ •์ˆ˜์˜ ๊ฐœ์ˆ˜ N(1 ≤ N ≤ 100)์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„์—๋Š” ์ •์ˆ˜๊ฐ€ ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„๋˜์–ด์ ธ์žˆ๋‹ค. ์…‹์งธ ์ค„์—๋Š” ์ฐพ์œผ๋ ค๊ณ  ํ•˜๋Š” ์ •์ˆ˜ v๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ž…๋ ฅ์œผ๋กœ ์ฃผ์–ด์ง€๋Š” ์ •์ˆ˜์™€ v๋Š” -100๋ณด๋‹ค ํฌ๊ฑฐ 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[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i]..
https://www.acmicpc.net/problem/13458 13458๋ฒˆ: ์‹œํ—˜ ๊ฐ๋… ์ฒซ์งธ ์ค„์— ์‹œํ—˜์žฅ์˜ ๊ฐœ์ˆ˜ N(1 ≤ N ≤ 1,000,000)์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„์—๋Š” ๊ฐ ์‹œํ—˜์žฅ์— ์žˆ๋Š” ์‘์‹œ์ž์˜ ์ˆ˜ Ai (1 ≤ Ai ≤ 1,000,000)๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์…‹์งธ ์ค„์—๋Š” B์™€ C๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. (1 ≤ B, C ≤ 1,000,000) 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[] arr = new int[n]; // ์‹œํ—˜์žฅ์— ์žˆ๋Š”..
https://school.programmers.co.kr/learn/courses/30/lessons/12932 import java.util.Arrays; class Solution { public int[] solution(long n) { String s = Long.toString(n); StringBuffer sb = new StringBuffer(s); String a = sb.reverse().toString(); String[] arr = a.split(""); int[] answer = new int[arr.length]; for (int i = 0; i < arr.length; i++) { answer[i] = Integer.parseInt(arr[i]); } return answer..
https://school.programmers.co.kr/learn/courses/30/lessons/12931 public class Solution { public int solution(int n) { int answer = 0; String s = Integer.toString(n); for(int i = 0; i < s.length(); i++){ answer += Integer.parseInt(s.substring(i, i+1)); } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/82612# class Solution { public long solution(int price, int money, int count) { long cost = 0; for(int i = 1; i = cost) { answer = 0; } return answer; } }
https://www.acmicpc.net/problem/1769 1769๋ฒˆ: 3์˜ ๋ฐฐ์ˆ˜ ๋ฌธ์ œ๊ฐ€ ์ž˜ ํ’€๋ฆฌ์ง€ ์•Š์„ ๋•Œ, ๋ฌธ์ œ๋ฅผ ๋ฐ”๋ผ๋ณด๋Š” ์‹œ๊ฐ์„ ์กฐ๊ธˆ๋งŒ ๋‹ค๋ฅด๊ฒŒ ๊ฐ€์ง€๋ฉด ๋ฌธ์ œ๊ฐ€ ์‰ฝ๊ฒŒ ํ’€๋ฆฌ๋Š” ๊ฒฝํ—˜์„ ์ข…์ข… ํ•ด ๋ณด์•˜์„ ๊ฒƒ์ด๋‹ค. ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ์ง€๋งŒ ๊ทธ ์ค‘ ํ•˜๋‚˜๋กœ ์šฐ๋ฆฌ๊ฐ€ ํ’€๊ณ  ์‹ถ์€ ๋ฌธ์ œ๋ฅผ www.acmicpc.net 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 InputStrea..
daxx0ne
'ALGORITHM ๐Ÿค–' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (8 Page)