From 896d594fde710b5a3052ecb40af17d360efa38df Mon Sep 17 00:00:00 2001 From: suyeun84 <81475092+suyeun84@users.noreply.github.com> Date: Sat, 8 Nov 2025 22:16:21 +0900 Subject: [PATCH] =?UTF-8?q?[20251108]=20BOJ=20/=20G5=20/=20=EC=A0=9C?= =?UTF-8?q?=EA=B3=B1=EC=88=98=20=EC=B0=BE=EA=B8=B0=20/=20=EA=B9=80?= =?UTF-8?q?=EC=88=98=EC=97=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1\354\210\230 \354\260\276\352\270\260.md" | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 "suyeun84/202511/08 BOJ G5 \354\240\234\352\263\261\354\210\230 \354\260\276\352\270\260.md" diff --git "a/suyeun84/202511/08 BOJ G5 \354\240\234\352\263\261\354\210\230 \354\260\276\352\270\260.md" "b/suyeun84/202511/08 BOJ G5 \354\240\234\352\263\261\354\210\230 \354\260\276\352\270\260.md" new file mode 100644 index 00000000..5458b767 --- /dev/null +++ "b/suyeun84/202511/08 BOJ G5 \354\240\234\352\263\261\354\210\230 \354\260\276\352\270\260.md" @@ -0,0 +1,54 @@ +```java +import java.io.*; +import java.util.*; + +public class Main { + public static int N, M; + public static int[][] map; + public static String S, T; + public static int result = -1; + public static void main(String[] args) throws IOException{ + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + StringTokenizer st = new StringTokenizer(br.readLine()); + N = Integer.parseInt(st.nextToken()); + M = Integer.parseInt(st.nextToken()); + + map = new int[N][M]; + for(int i=0;i= 0 && nI < N && nJ >= 0 && nJ < M) { + now *= 10; + now += map[nI][nJ]; + + int sqrt_check = (int) Math.sqrt( (double) now); + if( sqrt_check * sqrt_check == now) result = Math.max(result, now); + + nI += di; + nJ += dj; + } + } + } + } + } + System.out.println(result); + } +} +```