본문 바로가기

Problem Solving1242

[백준] 10263 Opening Ceremony - Greedy / Java • 문제 링크 10263번: Opening Ceremony The first line of input contains the number of blocks n, where 2 ≤ n ≤ 100 000. The second line contains n consecutive block heights hi for i = 1, 2, ... , n, where 1 ≤ hi ≤ 1 000 000. www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.Arrays; public class Main { public static voi.. 2024. 1. 12.
[백준] 10774 저지 - Greedy / Java • 문제 링크 10774번: 저지 학교 대표팀은 1부터 번호가 매겨진 저지를 학생 선수들에게 배분하고자 한다. 저지의 사이즈는 S, M, L 중 하나이다 (물론 S=small, M=medium, L=Large다). 각각의 선수들은 구체적인 저지의 번호와 선호 www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws IOException { BufferedWriter bw = new BufferedWriter(new OutputStream.. 2024. 1. 11.
[백준] 5991 Papaya Jungle - Graph Theory / Java • 문제 링크 5991번: Papaya Jungle Bessie has wandered off the farm into the adjoining farmer's land. He raises delicious papaya fruit, which is a delicacy for cows. The papaya jungle is partitioned into a grid of squares with R rows and C columns (1 2024. 1. 10.
[백준] 26999 Satellite Photographs - Graph Theory / Java • 문제 링크 26999번: Satellite Photographs Farmer John purchased satellite photos of W x H pixels of his farm (1 ≤ W ≤ 80, 1 ≤ H ≤ 1000) and wishes to determine the largest 'contiguous' (connected) pasture. Pastures are contiguous when any pair of pixels in a pasture can be connected by tra www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOExceptio.. 2024. 1. 9.
[백준] 6018 Tea Time - Graph Theory / Java • 문제 링크 6018번: Tea Time N (1 2024. 1. 8.
[백준] 6188 Clear Cold Water - Graph Theory / Java • 문제 링크 6188번: Clear Cold Water The steamy, sweltering summers of Wisconsin's dairy district stimulate the cows to slake their thirst. Farmer John pipes clear cold water into a set of N (3 2024. 1. 7.