user-img
์•Œ๊ณ ๋ฆฌ์ฆ˜ 260
๋ฐฑ์ค€ 11718๋ฒˆ ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅํ•˜๊ธฐ
11718๋ฒˆ: ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅํ•˜๊ธฐ (acmicpc.net) 11718๋ฒˆ: ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅํ•˜๊ธฐ ์ž…๋ ฅ์ด ์ฃผ์–ด์ง„๋‹ค. ์ž…๋ ฅ์€ ์ตœ๋Œ€ 100์ค„๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๊ณ , ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž, ๋Œ€๋ฌธ์ž, ๊ณต๋ฐฑ, ์ˆซ์ž๋กœ๋งŒ ์ด๋ฃจ์–ด์ ธ ์žˆ๋‹ค. ๊ฐ ์ค„์€ 100๊ธ€์ž๋ฅผ ๋„˜์ง€ ์•Š์œผ๋ฉฐ, ๋นˆ ์ค„์€ ์ฃผ์–ด์ง€์ง€ ์•Š๋Š”๋‹ค. ๋˜, ๊ฐ ์ค„์€ ๊ณต๋ฐฑ์œผ๋กœ ์‹œ www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ String s = sc.nextLine(); System.out.println(s); } } }
2023.05.31
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 5622๋ฒˆ ๋‹ค์ด์–ผ ํ•ด๋‹ต
5622๋ฒˆ: ๋‹ค์ด์–ผ (acmicpc.net) 5622๋ฒˆ: ๋‹ค์ด์–ผ ์ฒซ์งธ ์ค„์— ์•ŒํŒŒ๋ฒณ ๋Œ€๋ฌธ์ž๋กœ ์ด๋ฃจ์–ด์ง„ ๋‹จ์–ด๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๋‹จ์–ด์˜ ๊ธธ์ด๋Š” 2๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™๊ณ , 15๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™๋‹ค. www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // ์ž…๋ ฅ ๋ฐ›์•„์„œ ๋‚ฑ๊ฐœ์˜ ๋ฌธ์ž๋กœ ๋‚˜๋ˆ„๊ธฐ String s = sc.nextLine(); char[] chars = new char[s.length()]; // ๊ฑธ๋ฆฌ๋Š” ์‹œ๊ฐ„ ๊ณ„์‚ฐํ•ด์„œ ๋„ฃ๋Š” ๊ณณ int total = 0; for (int i = 0; i < s.length();..
2023.05.31
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 2908๋ฒˆ ์ƒ์ˆ˜ ํ•ด๋‹ต
2908๋ฒˆ: ์ƒ์ˆ˜ (acmicpc.net) 2908๋ฒˆ: ์ƒ์ˆ˜ ์ƒ๊ทผ์ด์˜ ๋™์ƒ ์ƒ์ˆ˜๋Š” ์ˆ˜ํ•™์„ ์ •๋ง ๋ชปํ•œ๋‹ค. ์ƒ์ˆ˜๋Š” ์ˆซ์ž๋ฅผ ์ฝ๋Š”๋ฐ ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค. ์ด๋ ‡๊ฒŒ ์ˆ˜ํ•™์„ ๋ชปํ•˜๋Š” ์ƒ์ˆ˜๋ฅผ ์œ„ํ•ด์„œ ์ƒ๊ทผ์ด๋Š” ์ˆ˜์˜ ํฌ๊ธฐ๋ฅผ ๋น„๊ตํ•˜๋Š” ๋ฌธ์ œ๋ฅผ ๋‚ด์ฃผ์—ˆ๋‹ค. ์ƒ๊ทผ์ด๋Š” ์„ธ ์ž๋ฆฌ ์ˆ˜ ๋‘ www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // ๊ณต๋ฐฑ์„ ๊ธฐ์ค€์œผ๋กœ ์ž…๋ ฅ๊ฐ’ ๋‚˜๋ˆ  ๋ฐ›๊ธฐ String Q1 = sc.next(); String Q2 = sc.next(); // 3 ๋ฒˆ์งธ ์ž๋ฆฌ์ˆ˜์™€ ์ฒซ ๋ฒˆ์งธ ์ž๋ฆฌ์ˆ˜๋ฅผ ๋’ค์ง‘์–ด ์ €์žฅ String S1 = Q..
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 1152๋ฒˆ ๋‹จ์–ด์˜ ๊ฐœ์ˆ˜
1152๋ฒˆ: ๋‹จ์–ด์˜ ๊ฐœ์ˆ˜ (acmicpc.net) 1152๋ฒˆ: ๋‹จ์–ด์˜ ๊ฐœ์ˆ˜ ์ฒซ ์ค„์— ์˜์–ด ๋Œ€์†Œ๋ฌธ์ž์™€ ๊ณต๋ฐฑ์œผ๋กœ ์ด๋ฃจ์–ด์ง„ ๋ฌธ์ž์—ด์ด ์ฃผ์–ด์ง„๋‹ค. ์ด ๋ฌธ์ž์—ด์˜ ๊ธธ์ด๋Š” 1,000,000์„ ๋„˜์ง€ ์•Š๋Š”๋‹ค. ๋‹จ์–ด๋Š” ๊ณต๋ฐฑ ํ•œ ๊ฐœ๋กœ ๊ตฌ๋ถ„๋˜๋ฉฐ, ๊ณต๋ฐฑ์ด ์—ฐ์†ํ•ด์„œ ๋‚˜์˜ค๋Š” ๊ฒฝ์šฐ๋Š” ์—†๋‹ค. ๋˜ํ•œ ๋ฌธ์ž์—ด www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); String [] strings = s.split("\\s"); System.out..
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 2675๋ฒˆ ๋ฌธ์ž์—ด ๋ฐ˜๋ณต
2675๋ฒˆ: ๋ฌธ์ž์—ด ๋ฐ˜๋ณต (acmicpc.net) 2675๋ฒˆ: ๋ฌธ์ž์—ด ๋ฐ˜๋ณต ๋ฌธ์ž์—ด S๋ฅผ ์ž…๋ ฅ๋ฐ›์€ ํ›„์—, ๊ฐ ๋ฌธ์ž๋ฅผ R๋ฒˆ ๋ฐ˜๋ณตํ•ด ์ƒˆ ๋ฌธ์ž์—ด P๋ฅผ ๋งŒ๋“  ํ›„ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. ์ฆ‰, ์ฒซ ๋ฒˆ์งธ ๋ฌธ์ž๋ฅผ R๋ฒˆ ๋ฐ˜๋ณตํ•˜๊ณ , ๋‘ ๋ฒˆ์งธ ๋ฌธ์ž๋ฅผ R๋ฒˆ ๋ฐ˜๋ณตํ•˜๋Š” ์‹์œผ๋กœ P๋ฅผ ๋งŒ๋“ค๋ฉด ๋œ๋‹ค www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for (int test_case = 0; test_case < N; test_case++) { int R = sc.nextInt(..
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 10809๋ฒˆ ์•ŒํŒŒ๋ฒณ ์ฐพ๊ธฐ
10809๋ฒˆ: ์•ŒํŒŒ๋ฒณ ์ฐพ๊ธฐ (acmicpc.net) 10809๋ฒˆ: ์•ŒํŒŒ๋ฒณ ์ฐพ๊ธฐ ๊ฐ๊ฐ์˜ ์•ŒํŒŒ๋ฒณ์— ๋Œ€ํ•ด์„œ, a๊ฐ€ ์ฒ˜์Œ ๋“ฑ์žฅํ•˜๋Š” ์œ„์น˜, b๊ฐ€ ์ฒ˜์Œ ๋“ฑ์žฅํ•˜๋Š” ์œ„์น˜, ... z๊ฐ€ ์ฒ˜์Œ ๋“ฑ์žฅํ•˜๋Š” ์œ„์น˜๋ฅผ ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„ํ•ด์„œ ์ถœ๋ ฅํ•œ๋‹ค. ๋งŒ์•ฝ, ์–ด๋–ค ์•ŒํŒŒ๋ฒณ์ด ๋‹จ์–ด์— ํฌํ•จ๋˜์–ด ์žˆ์ง€ ์•Š๋‹ค๋ฉด -1์„ ์ถœ www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); // ์ถœ๋ ฅ์— ์“ธ ์•ŒํŒŒ๋ฒณ ์œ„์น˜๋“ค, ๋งŒ์•ฝ์— ๊ทธ๋ฆ‡์— ํฌํ•จ๋˜์–ด ์žˆ๋‹ค๋ฉด, ๊ทธ๋ฆ‡ ๋‚ด index๋ฅผ ๋‹ด๊ณ , ํฌํ•จ ์•ˆ๋˜์–ด ์žˆ๋‹ค๋ฉด -1 i..
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 11720๋ฒˆ ์ˆซ์ž์˜ ํ•ฉ ํ•ด๋‹ต
11720๋ฒˆ: ์ˆซ์ž์˜ ํ•ฉ (acmicpc.net) 11720๋ฒˆ: ์ˆซ์ž์˜ ํ•ฉ ์ฒซ์งธ ์ค„์— ์ˆซ์ž์˜ ๊ฐœ์ˆ˜ N (1 ≤ N ≤ 100)์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„์— ์ˆซ์ž N๊ฐœ๊ฐ€ ๊ณต๋ฐฑ์—†์ด ์ฃผ์–ด์ง„๋‹ค. www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.nextLine(); String s = sc.nextLine(); int total = 0; for (int test_case = 0; test_case < N; test_case++) { char c = s.charA..
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 11654๋ฒˆ ์•„์Šคํ‚ค ์ฝ”๋“œ ํ•ด๋‹ต
11654๋ฒˆ: ์•„์Šคํ‚ค ์ฝ”๋“œ (acmicpc.net) 11654๋ฒˆ: ์•„์Šคํ‚ค ์ฝ”๋“œ ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž, ๋Œ€๋ฌธ์ž, ์ˆซ์ž 0-9์ค‘ ํ•˜๋‚˜๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ, ์ฃผ์–ด์ง„ ๊ธ€์ž์˜ ์•„์Šคํ‚ค ์ฝ”๋“œ๊ฐ’์„ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int A = (int)s.charAt(0); System.out.println(A); } }
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 9086๋ฒˆ ๋ฌธ์ž์—ด
9086๋ฒˆ: ๋ฌธ์ž์—ด (acmicpc.net) 9086๋ฒˆ: ๋ฌธ์ž์—ด ์ž…๋ ฅ์˜ ์ฒซ ์ค„์—๋Š” ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค์˜ ๊ฐœ์ˆ˜ T(1 ≤ T ≤ 10)๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๊ฐ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋Š” ํ•œ ์ค„์— ํ•˜๋‚˜์˜ ๋ฌธ์ž์—ด์ด ์ฃผ์–ด์ง„๋‹ค. ๋ฌธ์ž์—ด์€ ์•ŒํŒŒ๋ฒณ A~Z ๋Œ€๋ฌธ์ž๋กœ ์ด๋ฃจ์–ด์ง€๋ฉฐ ์•ŒํŒŒ๋ฒณ ์‚ฌ์ด์— ๊ณต๋ฐฑ์€ ์—†์œผ www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.nextLine(); for (int test_case = 0; test_case < N; test_case++) { StringBuil..
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 2743๋ฒˆ ๋‹จ์–ด ๊ธธ์ด ์žฌ๊ธฐ
2743๋ฒˆ: ๋‹จ์–ด ๊ธธ์ด ์žฌ๊ธฐ (acmicpc.net) 2743๋ฒˆ: ๋‹จ์–ด ๊ธธ์ด ์žฌ๊ธฐ ์•ŒํŒŒ๋ฒณ์œผ๋กœ๋งŒ ์ด๋ฃจ์–ด์ง„ ๋‹จ์–ด๋ฅผ ์ž…๋ ฅ๋ฐ›์•„, ๊ทธ ๊ธธ์ด๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); System.out.println(s.length()); } }
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 27866๋ฒˆ ํ•ด๋‹ต
27866๋ฒˆ: ๋ฌธ์ž์™€ ๋ฌธ์ž์—ด (acmicpc.net) 27866๋ฒˆ: ๋ฌธ์ž์™€ ๋ฌธ์ž์—ด ์ฒซ์งธ ์ค„์— ์˜์–ด ์†Œ๋ฌธ์ž์™€ ๋Œ€๋ฌธ์ž๋กœ๋งŒ ์ด๋ฃจ์–ด์ง„ ๋‹จ์–ด $S$๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๋‹จ์–ด์˜ ๊ธธ์ด๋Š” ์ตœ๋Œ€ $1\,000$์ด๋‹ค. ๋‘˜์งธ ์ค„์— ์ •์ˆ˜ $i$๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ($1 \le i \le \left|S\right|$) www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int N = sc.nextInt(); char[] strings = new char[s.length()]; // S..
2023.05.30
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 1546๋ฒˆ ํ‰๊ท 
1546๋ฒˆ: ํ‰๊ท  (acmicpc.net) 1546๋ฒˆ: ํ‰๊ท  ์ฒซ์งธ ์ค„์— ์‹œํ—˜ ๋ณธ ๊ณผ๋ชฉ์˜ ๊ฐœ์ˆ˜ N์ด ์ฃผ์–ด์ง„๋‹ค. ์ด ๊ฐ’์€ 1000๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™๋‹ค. ๋‘˜์งธ ์ค„์— ์„ธ์ค€์ด์˜ ํ˜„์žฌ ์„ฑ์ ์ด ์ฃผ์–ด์ง„๋‹ค. ์ด ๊ฐ’์€ 100๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์Œ์ด ์•„๋‹Œ ์ •์ˆ˜์ด๊ณ , ์ ์–ด๋„ ํ•˜๋‚˜์˜ ๊ฐ’์€ 0๋ณด www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.ArrayList; 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(); double arr[] = new double[..
2023.05.29
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
10811๋ฒˆ ๋ฐ”๊ตฌ๋‹ˆ ๋’ค์ง‘๊ธฐ
10811๋ฒˆ: ๋ฐ”๊ตฌ๋‹ˆ ๋’ค์ง‘๊ธฐ (acmicpc.net) 10811๋ฒˆ: ๋ฐ”๊ตฌ๋‹ˆ ๋’ค์ง‘๊ธฐ ๋„ํ˜„์ด๋Š” ๋ฐ”๊ตฌ๋‹ˆ๋ฅผ ์ด N๊ฐœ ๊ฐ€์ง€๊ณ  ์žˆ๊ณ , ๊ฐ๊ฐ์˜ ๋ฐ”๊ตฌ๋‹ˆ์—๋Š” 1๋ฒˆ๋ถ€ํ„ฐ N๋ฒˆ๊นŒ์ง€ ๋ฒˆํ˜ธ๊ฐ€ ์ˆœ์„œ๋Œ€๋กœ ์ ํ˜€์ ธ ์žˆ๋‹ค. ๋ฐ”๊ตฌ๋‹ˆ๋Š” ์ผ๋ ฌ๋กœ ๋†“์—ฌ์ ธ ์žˆ๊ณ , ๊ฐ€์žฅ ์™ผ์ชฝ ๋ฐ”๊ตฌ๋‹ˆ๋ฅผ 1๋ฒˆ์งธ ๋ฐ”๊ตฌ๋‹ˆ, ๊ทธ ๋‹ค์Œ ๋ฐ”๊ตฌ๋‹ˆ๋ฅผ 2 www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList list = new ArrayList(); // N ๊ฐœ๋ฅผ ๋ฐฐ์—ด ์†์— ์ฑ„์šฐ๊ธฐ int N = sc.next..
2023.05.29
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 3052๋ฒˆ ํ•ด๋‹ต
3052๋ฒˆ: ๋‚˜๋จธ์ง€ (acmicpc.net) 3052๋ฒˆ: ๋‚˜๋จธ์ง€ ๊ฐ ์ˆ˜๋ฅผ 42๋กœ ๋‚˜๋ˆˆ ๋‚˜๋จธ์ง€๋Š” 39, 40, 41, 0, 1, 2, 40, 41, 0, 1์ด๋‹ค. ์„œ๋กœ ๋‹ค๋ฅธ ๊ฐ’์€ 6๊ฐœ๊ฐ€ ์žˆ๋‹ค. www.acmicpc.net 1.๋‚ด ์ฝ”๋“œ import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList list = new ArrayList(); for (int i = 0; i < 10; i++) { list.add(sc.nextInt()); } System.out.println(list.s..
2023.05.29
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
๋ฐฑ์ค€ 5597๋ฒˆ ์ •๋‹ต
5597๋ฒˆ: ๊ณผ์ œ ์•ˆ ๋‚ด์‹  ๋ถ„..? (acmicpc.net) 5597๋ฒˆ: ๊ณผ์ œ ์•ˆ ๋‚ด์‹  ๋ถ„..? X๋Œ€ํ•™ M๊ต์ˆ˜๋‹˜์€ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์ˆ˜์—…์„ ๋งก๊ณ  ์žˆ๋‹ค. ๊ต์‹ค์—” ํ•™์ƒ์ด 30๋ช…์ด ์žˆ๋Š”๋ฐ, ํ•™์ƒ ๋ช…๋ถ€์—” ๊ฐ ํ•™์ƒ๋ณ„๋กœ 1๋ฒˆ๋ถ€ํ„ฐ 30๋ฒˆ๊นŒ์ง€ ์ถœ์„๋ฒˆํ˜ธ๊ฐ€ ๋ถ™์–ด ์žˆ๋‹ค. ๊ต์ˆ˜๋‹˜์ด ๋‚ด์ค€ ํŠน๋ณ„๊ณผ์ œ๋ฅผ 28๋ช…์ด ์ œ์ถœํ–ˆ๋Š”๋ฐ, www.acmicpc.net 1. ๋‚ด ์ฝ”๋“œ import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList list = new ArrayList(); ArrayList Thirty = new Ar..
2023.05.29
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy D2 1204. [S/W ๋ฌธ์ œํ•ด๊ฒฐ ๊ธฐ๋ณธ] 1์ผ์ฐจ - ์ตœ๋นˆ์ˆ˜ ๊ตฌํ•˜๊ธฐ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด ์ฝ”๋“œ import java.util.*; class Solution { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int test_case = 1; test_case x==I).count(); if(count
2023.05.20
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW D2 Expert Academy 1284 ์ˆ˜๋„์š”๊ธˆ ๊ฒฝ์Ÿ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด ์ฝ”๋“œ import java.util.*; class Solution { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int test_case = 1; test_case
2023.05.20
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW D2 Expert Academy 1985. ์•„๋ฆ„์ด์˜ ๋Œ ๋˜์ง€๊ธฐ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด ์ฝ”๋“œ C++๋กœ๋งŒ ํ’€ ์ˆ˜ ์žˆ๋Š” ๊ฑฐ ๋ชจ๋ฅด๊ณ  ๊ทธ๋ƒฅ ํ’€์—ˆ๋„ค์š”. ๋‹ต์€ ์ž˜ ๋‚˜์™”์Šต๋‹ˆ๋‹ค. import java.util.*; class Solution { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int test_case = 1; test_case
2023.05.20
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy D2 1288. ์ƒˆ๋กœ์šด ๋ถˆ๋ฉด์ฆ ์น˜๋ฃŒ๋ฒ•
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด ์ฝ”๋“œ import java.util.*; class Solution { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int test_case = 1; test_case ํ•ด๋‹น i*N์ด ์šฐ๋ฆฌ๊ฐ€ ์›ํ•˜๋Š” ๊ฐ’ // ํ˜ธ์„์ด๊ฐ€ i*N๋ฒˆ์„ ์…Œ์„ ๋•Œ, N์˜ ๋ฐฐ์ˆ˜์˜ ์ž๋ฆฟ์ˆ˜๋“ค์„ ๋Œ์ด์ผœ ๋ณด๋ฉด 0~9๊นŒ์ง€ ๋‹ค ์žˆ์—ˆ๋‹ค. if(set.size() == 10){ System.out.printf("#%d %s\n"..
2023.05.18
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
thumbnail
1924.Base64 Decoder
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด ์ฝ”๋“œ ๋‚˜๋Š” java์— base64 decoder๊ฐ€ ์กด์žฌํ•˜๋Š”์ง€ ๋ชฐ๋ž๋‹ค. base64 ์ธ์ฝ”๋”ฉ & ๋””์ฝ”๋”ฉ ์›๋ฆฌ (tistory.com) ์ธ์ฝ”๋”ฉ๊ณผ ๋””์ฝ”๋”ฉ ์›๋ฆฌ๋Š” ์ด๊ฑธ ์ฐธ๊ณ  ๋ฐ”๋žŒ ์›๋ฆฌ๋Š” ๊ฐ„๋‹จํ•˜๋‹ค. Encoding ์ฆ‰ ์•”ํ˜ธํ™”๋Š” ๋ฌธ์ž๋ฅผ ascII ์ฝ”๋“œ (2์ง„์ˆ˜)๋กœ ๋ฐ”๊พผ๋‹ค. ๋ฌธ์ž ๋‹น ๋ฐ”๋€ 2์ง„์ˆ˜๊ฐ€ 8bit ํ˜•ํƒœ๋กœ ์ ํžˆ๋„๋ก ๋งŒ๋“ค์–ด์ค€๋‹ค. (8bit๊ฐ€ ๋‹ค ์•ˆ ์ฐฐ ๊ฒฝ์šฐ MSB์— 0์„ ์ถ”๊ฐ€ํ•ด์ค€๋‹ค. (Msb > ๋งจ ์•ž bit, LSB > ๋งจ ๋’ค bit)) 8bit ์ด์ง„์ˆ˜ ํ˜•ํƒœ์˜ ๋ฌธ์ž๋ฅผ ๋‚˜์—ดํ•˜๊ณ  6bit ์”ฉ ์ž˜๋ผ์„œ ๋ณ€ํ™˜ํ•œ๋‹ค. (๋งŒ์•ฝ ๋งจ ๋์— 6bit..
2023.05.18
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy 1940. ๊ฐ€๋ž! RC์นด
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด ์ฝ”๋“œ import java.util.*; class Solution { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int test_case = 1; test_case ๊ฐ€์†๋ ฅ ์˜ค๋ฅด๋‚ด๋ฆผ ํ‘œํ˜„ // ๊ฑฐ๋ฆฌ = ์†๋ ฅ *์‹œ๊ฐ„, ์‹œ๊ฐ„์€ 1์ดˆ๋กœ default๋กœ ์ •ํ•ด์ ธ ์žˆ์œผ๋ฏ€๋กœ, ๊ฑฐ๋ฆฌ = ๊ทธ๋•Œ ๊ทธ๋•Œ์˜ ์†๋ ฅ์„ ๋”ํ•ด์ฃผ๋ฉด ๋œ๋‹ค. for (int i = 0; i < N; i++) { str[i] = sc..
2023.05.17
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด