From f208aa99fbabfa8fbb20306d6a2d441da8624000 Mon Sep 17 00:00:00 2001 From: soo <39691728+jisooolee@users.noreply.github.com> Date: Sat, 13 Jan 2024 21:43:29 +0900 Subject: [PATCH 1/7] =?UTF-8?q?Rename=201961.=20=EC=88=AB=EC=9E=90=20?= =?UTF-8?q?=EB=B0=B0=EC=97=B4=20=ED=9A=8C=EC=A0=84=20to=201961.=20?= =?UTF-8?q?=EC=88=AB=EC=9E=90=20=EB=B0=B0=EC=97=B4=20=ED=9A=8C=EC=A0=84.ja?= =?UTF-8?q?va?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...36\220 \353\260\260\354\227\264 \355\232\214\354\240\204.java" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\354\235\264\354\247\200\354\210\230/SWEA/D2/1961. \354\210\253\354\236\220 \353\260\260\354\227\264 \355\232\214\354\240\204" => "\354\235\264\354\247\200\354\210\230/SWEA/D2/1961. \354\210\253\354\236\220 \353\260\260\354\227\264 \355\232\214\354\240\204.java" (100%) diff --git "a/\354\235\264\354\247\200\354\210\230/SWEA/D2/1961. \354\210\253\354\236\220 \353\260\260\354\227\264 \355\232\214\354\240\204" "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1961. \354\210\253\354\236\220 \353\260\260\354\227\264 \355\232\214\354\240\204.java" similarity index 100% rename from "\354\235\264\354\247\200\354\210\230/SWEA/D2/1961. \354\210\253\354\236\220 \353\260\260\354\227\264 \355\232\214\354\240\204" rename to "\354\235\264\354\247\200\354\210\230/SWEA/D2/1961. \354\210\253\354\236\220 \353\260\260\354\227\264 \355\232\214\354\240\204.java" From 7c6c4a41acea09f64c0fdd697b3151c3cc76f370 Mon Sep 17 00:00:00 2001 From: soo <39691728+jisooolee@users.noreply.github.com> Date: Sat, 13 Jan 2024 21:43:46 +0900 Subject: [PATCH 2/7] =?UTF-8?q?Rename=201974.=20=EC=8A=A4=EB=8F=84?= =?UTF-8?q?=EC=BF=A0=20=EA=B2=80=EC=A6=9D=20to=201974.=20=EC=8A=A4?= =?UTF-8?q?=EB=8F=84=EC=BF=A0=20=EA=B2=80=EC=A6=9D.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...212\244\353\217\204\354\277\240 \352\262\200\354\246\235.java" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\354\235\264\354\247\200\354\210\230/SWEA/D2/1974. \354\212\244\353\217\204\354\277\240 \352\262\200\354\246\235" => "\354\235\264\354\247\200\354\210\230/SWEA/D2/1974. \354\212\244\353\217\204\354\277\240 \352\262\200\354\246\235.java" (100%) diff --git "a/\354\235\264\354\247\200\354\210\230/SWEA/D2/1974. \354\212\244\353\217\204\354\277\240 \352\262\200\354\246\235" "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1974. \354\212\244\353\217\204\354\277\240 \352\262\200\354\246\235.java" similarity index 100% rename from "\354\235\264\354\247\200\354\210\230/SWEA/D2/1974. \354\212\244\353\217\204\354\277\240 \352\262\200\354\246\235" rename to "\354\235\264\354\247\200\354\210\230/SWEA/D2/1974. \354\212\244\353\217\204\354\277\240 \352\262\200\354\246\235.java" From 136ca971a32367e29e182c2d941803e3bc7e545e Mon Sep 17 00:00:00 2001 From: soo <39691728+jisooolee@users.noreply.github.com> Date: Sun, 14 Jan 2024 15:20:44 +0900 Subject: [PATCH 3/7] =?UTF-8?q?Create=2012712.=20=ED=8C=8C=EB=A6=AC?= =?UTF-8?q?=ED=87=B4=EC=B9=983.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...353\246\254\355\207\264\354\271\2303.java" | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 "\354\235\264\354\247\200\354\210\230/SWEA/D2/12712. \355\214\214\353\246\254\355\207\264\354\271\2303.java" diff --git "a/\354\235\264\354\247\200\354\210\230/SWEA/D2/12712. \355\214\214\353\246\254\355\207\264\354\271\2303.java" "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/12712. \355\214\214\353\246\254\355\207\264\354\271\2303.java" new file mode 100644 index 00000000..85143eb7 --- /dev/null +++ "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/12712. \355\214\214\353\246\254\355\207\264\354\271\2303.java" @@ -0,0 +1,51 @@ +import java.util.Scanner; + +class Solution { + public static void main(String args[]) throws Exception { + Scanner sc = new Scanner(System.in); + int T = sc.nextInt(); + + for(int test_case = 1; test_case <= T; test_case++) { + int N = sc.nextInt(); + int M = sc.nextInt(); + + int[][] flies = new int[N][N]; + for(int i = 0; i < N; i++) + for(int j = 0; j < N; j++) + flies[i][j] = sc.nextInt(); + + int max = 0; + for(int i = 0; i < N; i++) { + for(int j = 0; j < N; j++) { + int sum1 = flies[i][j]; + int sum2 = flies[i][j]; + for(int x = 1; x < M; x++) { + if(j - x >= 0) + sum1 += flies[i][j - x]; + if(j + x < N) + sum1 += flies[i][j + x]; + if(i - x >= 0) + sum1 += flies[i - x][j]; + if(i + x < N) + sum1 += flies[i + x][j]; + + if(i - x >= 0 && j - x >= 0) + sum2 += flies[i - x][j - x]; + if(i + x < N && j + x < N) + sum2 += flies[i + x][j + x]; + if(i - x >= 0 && j + x < N) + sum2 += flies[i - x][j + x]; + if(i + x < N && j - x >= 0) + sum2 += flies[i + x][j - x]; + } + + int tmp = sum1 > sum2 ? sum1 : sum2; + if(max < tmp) + max = tmp; + } + } + + System.out.println("#" + test_case + " " + max); + } + } +} From 726105d0ffa14af11d87c9888b7ed1819201cde1 Mon Sep 17 00:00:00 2001 From: soo <39691728+jisooolee@users.noreply.github.com> Date: Sun, 14 Jan 2024 16:06:39 +0900 Subject: [PATCH 4/7] Create 1204.java --- .../SWEA/D2/1204.java" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "\354\235\264\354\247\200\354\210\230/SWEA/D2/1204.java" diff --git "a/\354\235\264\354\247\200\354\210\230/SWEA/D2/1204.java" "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1204.java" new file mode 100644 index 00000000..7f0b8610 --- /dev/null +++ "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1204.java" @@ -0,0 +1,29 @@ +import java.util.Scanner; + +class Solution +{ + public static void main(String args[]) throws Exception + { + Scanner sc = new Scanner(System.in); + int T = sc.nextInt(); + + for(int test_case = 1; test_case <= T; test_case++) + { + sc.nextInt(); + + int[] scores = new int[101]; + for(int i = 0; i < 1000; i++){ + scores[sc.nextInt()]++; + } + + int[] result = {-1, 0}; + for(int i = 0; i < 101; i++) { + if(scores[i] > result[1] || (scores[i] == result[1] && i > result[0])) { + result[0] = i; + result[1] = scores[i]; + } + } + System.out.println("#" + test_case + " " + result[0]); + } + } +} From 5d095a0266e58993643c9c93923c7197f4146039 Mon Sep 17 00:00:00 2001 From: soo <39691728+jisooolee@users.noreply.github.com> Date: Sun, 14 Jan 2024 17:52:36 +0900 Subject: [PATCH 5/7] =?UTF-8?q?Create=201859.=20=EB=B0=B1=EB=A7=8C=20?= =?UTF-8?q?=EC=9E=A5=EC=9E=90=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\353\241\234\354\240\235\355\212\270.java" | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 "\354\235\264\354\247\200\354\210\230/SWEA/D2/1859. \353\260\261\353\247\214 \354\236\245\354\236\220 \355\224\204\353\241\234\354\240\235\355\212\270.java" diff --git "a/\354\235\264\354\247\200\354\210\230/SWEA/D2/1859. \353\260\261\353\247\214 \354\236\245\354\236\220 \355\224\204\353\241\234\354\240\235\355\212\270.java" "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1859. \353\260\261\353\247\214 \354\236\245\354\236\220 \355\224\204\353\241\234\354\240\235\355\212\270.java" new file mode 100644 index 00000000..b4d73cea --- /dev/null +++ "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1859. \353\260\261\353\247\214 \354\236\245\354\236\220 \355\224\204\353\241\234\354\240\235\355\212\270.java" @@ -0,0 +1,35 @@ +import java.util.Scanner; + +class Solution +{ + public static void main(String args[]) throws Exception + { + Scanner sc = new Scanner(System.in); + int T = sc.nextInt(); + + for(int test_case = 1; test_case <= T; test_case++) + { + int N = sc.nextInt(); + int[] prices = new int[N]; + for(int i = 0; i < N; i++) { + prices[i] = sc.nextInt(); + } + + int result = 0; + int idx = -1; + while(idx < N) { + int max = -1; + for(int i = idx + 1; i < prices.length; i++) { + if(prices[i] >= max) { + max = prices[i]; + idx = i; + } + } + for(int i = 0; i < idx; i++) { + result += max - prices[i]; + } + } + System.out.println("#" + test_case + " " + result); + } + } +} From 306e870f9516e5da246bcdee525d8a21f7a8242b Mon Sep 17 00:00:00 2001 From: soo <39691728+jisooolee@users.noreply.github.com> Date: Sun, 14 Jan 2024 18:13:27 +0900 Subject: [PATCH 6/7] =?UTF-8?q?Create=201940.=20=EA=B0=80=EB=9E=8F!=20RC?= =?UTF-8?q?=EC=B9=B4!.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...260\200\353\236\217! RC\354\271\264!.java" | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 "\354\235\264\354\247\200\354\210\230/SWEA/D2/1940. \352\260\200\353\236\217! RC\354\271\264!.java" diff --git "a/\354\235\264\354\247\200\354\210\230/SWEA/D2/1940. \352\260\200\353\236\217! RC\354\271\264!.java" "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1940. \352\260\200\353\236\217! RC\354\271\264!.java" new file mode 100644 index 00000000..953047ff --- /dev/null +++ "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1940. \352\260\200\353\236\217! RC\354\271\264!.java" @@ -0,0 +1,32 @@ +import java.util.Scanner; + +class Solution +{ + public static void main(String args[]) throws Exception + { + Scanner sc = new Scanner(System.in); + int T = sc.nextInt(); + + for(int test_case = 1; test_case <= T; test_case++) + { + int N = sc.nextInt(); + int v = 0; + int d = 0; + for(int i = 0; i < N; i++){ + int command = sc.nextInt(); + if(command == 0) + d += v; + else if(command == 1) { + v += sc.nextInt(); + d += v; + } + else { + int a = sc.nextInt(); + v = (v - a >= 0? v - a : 0); + d += v; + } + } + System.out.println("#" + test_case + " " + d); + } + } +} From 29a7c2401de35d8d1dc54ef735c44e3cc69ba1cb Mon Sep 17 00:00:00 2001 From: soo <39691728+jisooolee@users.noreply.github.com> Date: Tue, 16 Jan 2024 23:12:13 +0900 Subject: [PATCH 7/7] =?UTF-8?q?Create=201954.=20=EB=8B=AC=ED=8C=BD?= =?UTF-8?q?=EC=9D=B4=20=EC=88=AB=EC=9E=90.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...354\235\264 \354\210\253\354\236\220.java" | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 "\354\235\264\354\247\200\354\210\230/SWEA/D2/1954. \353\213\254\355\214\275\354\235\264 \354\210\253\354\236\220.java" diff --git "a/\354\235\264\354\247\200\354\210\230/SWEA/D2/1954. \353\213\254\355\214\275\354\235\264 \354\210\253\354\236\220.java" "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1954. \353\213\254\355\214\275\354\235\264 \354\210\253\354\236\220.java" new file mode 100644 index 00000000..2122fc70 --- /dev/null +++ "b/\354\235\264\354\247\200\354\210\230/SWEA/D2/1954. \353\213\254\355\214\275\354\235\264 \354\210\253\354\236\220.java" @@ -0,0 +1,42 @@ +import java.util.Scanner; + +class Solution +{ + public static void main(String args[]) throws Exception + { + Scanner sc = new Scanner(System.in); + int T = sc.nextInt(); + + for(int test_case = 1; test_case <= T; test_case++) + { + int N = sc.nextInt(); + int arr[][] = new int[N][N]; + + int[] dx = {0, 1, 0, -1}; + int[] dy = {1, 0, -1, 0}; + int dirIdx = 0; + + int cnt = 1; + + int r = 0; + int c = 0; + + while(cnt <= N * N){ + if(r + dx[dirIdx] >= N || r + dx[dirIdx] < 0 || c + dy[dirIdx] >= N || c + dy[dirIdx] < 0 || arr[r + dx[dirIdx]][c + dy[dirIdx]] != 0) + dirIdx = (dirIdx + 1) % 4; + arr[r][c] = cnt; + r += dx[dirIdx]; + c += dy[dirIdx]; + cnt++; + } + + System.out.println("#" + test_case); + for(int i = 0; i < N; i++) { + for(int j = 0; j < N; j++) { + System.out.print(arr[i][j] + " "); + } + System.out.println(); + } + } + } +}