누적합
-
https://www.acmicpc.net/problem/3020import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); //동굴의 길이 (총 석순과 종유석 개수) int h = Integer.parseInt(st.nextToken()); /..
[백준] #3020. 개똥 벌레 (골드 5)https://www.acmicpc.net/problem/3020import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); //동굴의 길이 (총 석순과 종유석 개수) int h = Integer.parseInt(st.nextToken()); /..
2024.06.13 -
https://www.acmicpc.net/problem/16139import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; String S = br.readLine(); //문자열 int q = Integer.parseInt(br.readLine()); //질문의 수 int n = S.length(); // 문자열의 길이 // 각 문자의 누적합을 저장할 2차원 배열 int[..
[백준] #16139. 인간-컴퓨터 상호작용 (실버 1)https://www.acmicpc.net/problem/16139import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; String S = br.readLine(); //문자열 int q = Integer.parseInt(br.readLine()); //질문의 수 int n = S.length(); // 문자열의 길이 // 각 문자의 누적합을 저장할 2차원 배열 int[..
2024.06.09 -
https://www.acmicpc.net/problem/2559import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int k = Integer.parseInt(st.nextToken()); //합을 구할 연속적인 날짜의 수 int[] ..
[백준] #2559. 수열 (실버 3)https://www.acmicpc.net/problem/2559import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int k = Integer.parseInt(st.nextToken()); //합을 구할 연속적인 날짜의 수 int[] ..
2024.06.09 -
https://www.acmicpc.net/problem/11659import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); StringBuilder sb = new StringBuilder(); int n = Integer.parseInt(st.nextToken()); int m = Integer.parseInt(st..
[백준] #11659. 구간 합 구하기4 (실버 3)https://www.acmicpc.net/problem/11659import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); StringBuilder sb = new StringBuilder(); int n = Integer.parseInt(st.nextToken()); int m = Integer.parseInt(st..
2024.06.06 -
https://www.acmicpc.net/problem/2167import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int m = Integer.parseInt(st.nextToken()); int[][] nums = new int[n][..
[백준] #2167. 2차원 배열의 합 (실버 5)https://www.acmicpc.net/problem/2167import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int m = Integer.parseInt(st.nextToken()); int[][] nums = new int[n][..
2024.06.05 -
https://www.acmicpc.net/problem/11441import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine()); int[] nums = new int[n]; for (int i = 0; i 주의할 점▼ 구간의 시작이 첫번째부터이면 앞..
[백준] #11441. 합 구하기 (실버 3)https://www.acmicpc.net/problem/11441import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine()); int[] nums = new int[n]; for (int i = 0; i 주의할 점▼ 구간의 시작이 첫번째부터이면 앞..
2024.06.05 -
https://www.acmicpc.net/problem/2851import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] score = new int[10]; for (int i = 0; i
[백준] #2851. 슈퍼 마리오 (브론즈 1)https://www.acmicpc.net/problem/2851import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] score = new int[10]; for (int i = 0; i
2024.06.05