ALGORITHM ๐Ÿค–

์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต / ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„
https://www.acmicpc.net/problem/2741 2741๋ฒˆ: N ์ฐ๊ธฐ ์ž์—ฐ์ˆ˜ N์ด ์ฃผ์–ด์กŒ์„ ๋•Œ, 1๋ถ€ํ„ฐ 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(); for(int i = 1; i
https://www.acmicpc.net/problem/25314 25314๋ฒˆ: ์ฝ”๋”ฉ์€ ์ฒด์œก๊ณผ๋ชฉ ์ž…๋‹ˆ๋‹ค ์˜ค๋Š˜์€ ํ˜œ์•„์˜ ๋ฉด์ ‘ ๋‚ ์ด๋‹ค. ๋ฉด์ ‘ ์ค€๋น„๋ฅผ ์—ด์‹ฌํžˆ ํ•ด์„œ ์•ž์„  ์งˆ๋ฌธ๋“ค์„ ์ž˜ ๋Œ€๋‹ตํ•œ ํ˜œ์•„๋Š” ์ด์ œ ๋งˆ์ง€๋ง‰์œผ๋กœ ์น ํŒ์— ์ง์ ‘ ์ฝ”๋”ฉํ•˜๋Š” ๋ฌธ์ œ๋ฅผ ๋ฐ›์•˜๋‹ค. ํ˜œ์•„๊ฐ€ ๋ฐ›์€ ๋ฌธ์ œ๋Š” ๋‘ ์ˆ˜๋ฅผ ๋”ํ•˜๋Š” ๋ฌธ์ œ์˜€๋‹ค. C++ 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 save = n / 4; for (int i = 0; i < save; i++) { System.out.print("..
https://www.acmicpc.net/problem/25304 25304๋ฒˆ: ์˜์ˆ˜์ฆ ์ค€์›์ด๋Š” ์ €๋ฒˆ ์ฃผ์— ์‚ด๋ฉด์„œ ์ฒ˜์Œ์œผ๋กœ ์ฝ”์ŠคํŠธ์ฝ”๋ฅผ ๊ฐ€ ๋ดค๋‹ค. ์ •๋ง ๋ฉ‹์กŒ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ, ๋ช‡ ๊ฐœ ๋‹ด์ง€๋„ ์•Š์•˜๋Š”๋ฐ ์ˆ˜์ƒํ•˜๊ฒŒ ๋†’์€ ๊ธˆ์•ก์ด ๋‚˜์˜ค๋Š” ๊ฒƒ์ด๋‹ค! ์ค€์›์ด๋Š” ์˜์ˆ˜์ฆ์„ ๋ณด๋ฉด์„œ ์ •ํ™•ํ•˜๊ฒŒ ๊ณ„์‚ฐ๋œ ๊ฒƒ www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); // ์˜์ˆ˜์ฆ์— ์ ํžŒ ์ด ๊ธˆ์•ก ์ž…๋ ฅ๋ฐ›๊ธฐ int n = sc.nextInt(); // ์˜์ˆ˜์ฆ์— ์ ํžŒ ๊ตฌ๋งคํ•œ ๋ฌผ๊ฑด ์ข…๋ฅ˜ ์ˆ˜ ์ž…๋ ฅ๋ฐ›๊ธฐ int[] arr =..
https://www.acmicpc.net/problem/8393 8393๋ฒˆ: ํ•ฉ n์ด ์ฃผ์–ด์กŒ์„ ๋•Œ, 1๋ถ€ํ„ฐ 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 = 0; for(int i = 1; i
https://www.acmicpc.net/problem/10950 10950๋ฒˆ: A+B - 3 ๋‘ ์ •์ˆ˜ A์™€ B๋ฅผ ์ž…๋ ฅ๋ฐ›์€ ๋‹ค์Œ, A+B๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int[] arr = new int[t]; // t๋งŒํผ ๋ฐฐ์—ด์˜ ํฌ๊ธฐ๋ฅผ ์ง€์ • int i = 0; while (i < t) { // t๋งŒํผ ๋ฐ˜๋ณต int a = sc.nextInt(); int b = sc.nextInt(); // a, b๋ฅผ ์ž…๋ ฅ๋ฐ›์•„์„œ a..
https://www.acmicpc.net/problem/2739 2739๋ฒˆ: ๊ตฌ๊ตฌ๋‹จ 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 x = sc.nextInt(); for(int i = 1; i
https://www.acmicpc.net/problem/14681 14681๋ฒˆ: ์‚ฌ๋ถ„๋ฉด ๊ณ ๋ฅด๊ธฐ ์  (x, y)์˜ ์‚ฌ๋ถ„๋ฉด ๋ฒˆํ˜ธ(1, 2, 3, 4 ์ค‘ ํ•˜๋‚˜)๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); if (x > 0 && y > 0){ //1์‚ฌ๋ถ„๋ฉด System.out.println("1"); } else if (x 0){ //2์‚ฌ๋ถ„๋ฉด System.out.println("2"); } else..
daxx0ne
'ALGORITHM ๐Ÿค–' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (15 Page)