From 6fd2987a2eb9ff63eeb019e91dfa87bd9cad62de Mon Sep 17 00:00:00 2001 From: Jinyeong Seol Date: Thu, 10 Jul 2025 14:08:49 +0900 Subject: [PATCH 1/2] Create .gitkeep --- JHLEE325/202507/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 JHLEE325/202507/.gitkeep diff --git a/JHLEE325/202507/.gitkeep b/JHLEE325/202507/.gitkeep new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/JHLEE325/202507/.gitkeep @@ -0,0 +1 @@ + From 410b01aafa7c1a1a407d664f65a6972876040ce2 Mon Sep 17 00:00:00 2001 From: JHLEE325 <82587652+JHLEE325@users.noreply.github.com> Date: Thu, 10 Jul 2025 20:33:26 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[20250710]=20BOJ=20/=20G4=20/=20=EA=B3=A0?= =?UTF-8?q?=EC=B8=B5=20=EA=B1=B4=EB=AC=BC=20/=20=EC=9D=B4=EC=A4=80?= =?UTF-8?q?=ED=9D=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\240\354\270\265 \352\261\264\353\254\274" | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 "JHLEE325/202507/10 BOJ G4 \352\263\240\354\270\265 \352\261\264\353\254\274" diff --git "a/JHLEE325/202507/10 BOJ G4 \352\263\240\354\270\265 \352\261\264\353\254\274" "b/JHLEE325/202507/10 BOJ G4 \352\263\240\354\270\265 \352\261\264\353\254\274" new file mode 100644 index 00000000..cb22ab85 --- /dev/null +++ "b/JHLEE325/202507/10 BOJ G4 \352\263\240\354\270\265 \352\261\264\353\254\274" @@ -0,0 +1,49 @@ +'''java +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + int n = Integer.parseInt(st.nextToken()); + + st = new StringTokenizer(br.readLine()); + + int[] buildings = new int[n]; + + for (int i = 0; i < n; i++) { + buildings[i] = Integer.parseInt(st.nextToken()); + } + + int max = 0; + for (int i = 0; i < n; i++) { + double temp = 1000000001; + int count = 0; + for (int j = i - 1; j >= 0; j--) { + double degree = (double) (buildings[i] - buildings[j]) / (i - j); + if (temp > degree) { + count++; + temp = degree; + } else { + continue; + } + } + temp = -1000000001; + for (int j = i + 1; j < n; j++) { + double degree = (double) (buildings[j] - buildings[i]) / (j - i); + if (temp < degree) { + count++; + temp = degree; + } else { + continue; + } + } + max = Math.max(max, count); + } + + System.out.println(max); + } +} +'''