2020/10/16 2

๋ฐฑ์ค€ 1874 | ์Šคํƒ ์ˆ˜์—ด

์ง„์งœ ๋ชจ๋ฅด๊ฒ ๋‹ค. ๋„ˆ๋ฌด ์–ด๋ ต๋‹ค. ์–ด๋–ป๊ฒŒ๋“  ํ’€์–ด ๋ณด๊ฒ ๋‹ค๊ณ  ์•ˆ๊ฐ„ํž˜์„ ์“ด ํ”์ . ๋ง์•„๋จน์„ ๋‚ด ์ฝ”๋“œ package ์‹ฌ์„ฑํ—Œ.์•Œ๊ณ ๋ฆฌ์ฆ˜_2์ฃผ์ฐจ; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class ์Šคํƒ์ˆ˜์—ด_1874 { static public BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static public int[] input(int n) throws NumberFormatException, IOExc..

Algorithm 2020.10.16

๋ฐฑ์ค€ 10818 | ์ตœ์†Œ, ์ตœ๋Œ“๊ฐ’ ๊ตฌํ•˜๊ธฐ

์ตœ์†Œ, ์ตœ๋Œ“๊ฐ’ ๊ตฌํ•˜๊ธฐ ๋ฉด์ ‘ ์ค€๋น„๋ฅผ ํ•˜๋ฉด์„œ ์„ ํƒ ์ •๋ ฌ๊ณผ ๋ฒ„๋ธ” ์ •๋ ฌ์ด ๋ฌธ์ œ๋กœ ๋‚˜์˜จ๋‹ค๊ณ  ๋“ค์–ด์„œ ์„ ํƒ ์ •๋ ฌ์— ๋Œ€ํ•ด์„œ ๋จผ์ € ๊ณต๋ถ€๋ฅผ ํ–ˆ๋‹ค. ์˜ˆ์ „์— ํ’€์—ˆ๋˜ ๋ฌธ์ œ์ง€๋งŒ ๋‹ค์‹œ ๋“ค์—ฌ๋‹ค๋ณด์ง€ ์•Š์•„์„œ ๋‹ค ๊นŒ๋จน์—ˆ๋‹ค. ์–ด์จŒ๋“ , ๋‚˜๋Š” ์ด๋ฒˆ ๋ฌธ์ œ๋ฅผ ์„ ํƒ ์ •๋ ฌ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ํ™œ์šฉํ•ด์„œ ๋ฌธ์ œ๋ฅผ ํ’€์—ˆ๋‹ค. ๊ทผ๋ฐ ๊ฒฐ๊ณผ๋Š” ๋Ÿฐํƒ€์ž„ ์—๋Ÿฌ์˜€๋‹ค. ๋Ÿฐํƒ€์ž„ ์—๋Ÿฌ ์ฝ”๋“œ import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] list = ..

Algorithm 2020.10.16