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번째 문자를..