ALGORITHM ๐Ÿค–

์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต / ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„
https://www.acmicpc.net/problem/1271 1271๋ฒˆ: ์—„์ฒญ๋‚œ ๋ถ€์ž2 ์ฒซ์งธ ์ค„์—๋Š” ์ตœ๋ฐฑ์ค€ ์กฐ๊ต๊ฐ€ ๊ฐ€์ง„ ๋ˆ n๊ณผ ๋ˆ์„ ๋ฐ›์œผ๋Ÿฌ ์˜จ ์ƒ๋ช…์ฒด์˜ ์ˆ˜ m์ด ์ฃผ์–ด์ง„๋‹ค. (1 ≤ m ≤ n ≤ 101000, m๊ณผ n์€ 10์ง„์ˆ˜ ์ •์ˆ˜) www.acmicpc.net import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger n = sc.nextBigInteger(); BigInteger m = sc.nextBigInteger(); BigInteger cost = n.d..
https://www.acmicpc.net/problem/10828 10828๋ฒˆ: ์Šคํƒ ์ฒซ์งธ ์ค„์— ์ฃผ์–ด์ง€๋Š” ๋ช…๋ น์˜ ์ˆ˜ N (1 ≤ N ≤ 10,000)์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„๋ถ€ํ„ฐ N๊ฐœ์˜ ์ค„์—๋Š” ๋ช…๋ น์ด ํ•˜๋‚˜์”ฉ ์ฃผ์–ด์ง„๋‹ค. ์ฃผ์–ด์ง€๋Š” ์ •์ˆ˜๋Š” 1๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™๊ณ , 100,000๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™๋‹ค. ๋ฌธ์ œ์— ๋‚˜์™€์žˆ์ง€ www.acmicpc.net import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.p..
https://www.acmicpc.net/problem/10773 10773๋ฒˆ: ์ œ๋กœ ์ฒซ ๋ฒˆ์งธ ์ค„์— ์ •์ˆ˜ K๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. (1 ≤ K ≤ 100,000) ์ดํ›„ K๊ฐœ์˜ ์ค„์— ์ •์ˆ˜๊ฐ€ 1๊ฐœ์”ฉ ์ฃผ์–ด์ง„๋‹ค. ์ •์ˆ˜๋Š” 0์—์„œ 1,000,000 ์‚ฌ์ด์˜ ๊ฐ’์„ ๊ฐ€์ง€๋ฉฐ, ์ •์ˆ˜๊ฐ€ "0" ์ผ ๊ฒฝ์šฐ์—๋Š” ๊ฐ€์žฅ ์ตœ๊ทผ์— ์“ด ์ˆ˜๋ฅผ ์ง€์šฐ๊ณ , ์•„๋‹ ๊ฒฝ www.acmicpc.net import java.util.Scanner; import java.util.Stack; public class Main { public static void main(String[] args) { Stack stack = new Stack(); Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int sum..
https://school.programmers.co.kr/learn/courses/30/lessons/12912 class Solution { public long solution(int a, int b) { long answer = 0; if(a < b){ for(int i = a; i
https://school.programmers.co.kr/learn/courses/30/lessons/12918 class Solution { public boolean solution(String s) { boolean answer = true; if(s.length() == 4 || s.length() == 6){ for(int i = 0; i '9'){ return false; } } } else return false; return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/77884 class Solution { public int solution(int left, int right) { int answer = 0; for(int i = left; i
https://www.acmicpc.net/problem/27866 27866๋ฒˆ: ๋ฌธ์ž์™€ ๋ฌธ์ž์—ด ์ฒซ์งธ ์ค„์— ์˜์–ด ์†Œ๋ฌธ์ž์™€ ๋Œ€๋ฌธ์ž๋กœ๋งŒ ์ด๋ฃจ์–ด์ง„ ๋‹จ์–ด $S$๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๋‹จ์–ด์˜ ๊ธธ์ด๋Š” ์ตœ๋Œ€ $1\,000$์ด๋‹ค. ๋‘˜์งธ ์ค„์— ์ •์ˆ˜ $i$๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ($1 \le i \le \left|S\right|$) www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int n = sc.nextInt(); System.out.println(s.charAt(n-1)); // n-1๋ฒˆ์งธ ๋ฌธ์ž๋ฅผ..
daxx0ne
'ALGORITHM ๐Ÿค–' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (9 Page)