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..
ALGORITHM ๐ค
์๊ณ ๋ฆฌ์ฆ ์ฐ์ต / ์ฝ๋ฉํ ์คํธ ์ค๋น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๋ฒ์งธ ๋ฌธ์๋ฅผ..