From e48df675d8f3d673c1520ee517b44bba4dade53f Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Tue, 21 Oct 2025 23:10:29 +0900 Subject: [PATCH] =?UTF-8?q?[20251021]=20PGM=20/=20Lv2=20/=20n^2=20?= =?UTF-8?q?=EB=B0=B0=EC=97=B4=20=EC=9E=90=EB=A5=B4=EA=B8=B0=20/=20?= =?UTF-8?q?=EC=9D=B4=EA=B0=95=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 \354\236\220\353\245\264\352\270\260.md" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "lkhyun/202510/21 PGM Lv2 n^2 \353\260\260\354\227\264 \354\236\220\353\245\264\352\270\260.md" diff --git "a/lkhyun/202510/21 PGM Lv2 n^2 \353\260\260\354\227\264 \354\236\220\353\245\264\352\270\260.md" "b/lkhyun/202510/21 PGM Lv2 n^2 \353\260\260\354\227\264 \354\236\220\353\245\264\352\270\260.md" new file mode 100644 index 00000000..2485529a --- /dev/null +++ "b/lkhyun/202510/21 PGM Lv2 n^2 \353\260\260\354\227\264 \354\236\220\353\245\264\352\270\260.md" @@ -0,0 +1,19 @@ +```java +class Solution { + public long[] solution(int n, long left, long right) { + long[] answer = new long[(int)(right-left+1)]; + + int idx = 0; + for(long i = left; i<=right; i++,idx++){ + long ii = i/n; + long jj = i%n; + if(ii>=jj){ + answer[idx] = ii+1; + }else{ + answer[idx] = jj+1; + } + } + return answer; + } +} +```