From 550009f19ff1ce886f9f5df975941c20f5904265 Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:53:10 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[20250203]=20BOJ=20/=20=EA=B3=A8=EB=93=9C4?= =?UTF-8?q?=20/=20=EB=B0=A9=EC=82=AC=ED=98=95=20=EA=B7=B8=EB=9E=98=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 --- ...\204 \354\235\264\352\260\225\355\230\204" | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 "lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204" diff --git "a/lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204" "b/lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204" new file mode 100644 index 00000000..7ad82ca7 --- /dev/null +++ "b/lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204" @@ -0,0 +1,51 @@ +```java +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.util.*; +public class Main { + static BufferedReader br; + static BufferedWriter bw; + static int[] comb = new int[8]; + static boolean[] visited = new boolean[8]; + static int[] points = new int[8]; + static int count = 0; + public static void main(String[] args) throws Exception { + br = new BufferedReader(new InputStreamReader(System.in)); + bw = new BufferedWriter(new OutputStreamWriter(System.out)); + StringTokenizer st = new StringTokenizer(br.readLine()); + for(int i=0;i<8;i++){ + points[i] = Integer.parseInt(st.nextToken()); + } + combination(0); + bw.write(count+""); + bw.flush(); + } + public static void combination(int depth){ + if(depth==8){ + for(int i=0;i<8;i++){ + if(omok(i)){return;} + } + count++; + return; + } + + for(int j=0;j<8;j++){ + if(visited[j]){continue;} + visited[j] = true; + comb[depth] = points[j]; + combination(depth+1); + visited[j] = false; + } + } + public static boolean omok(int curpoint){ + double prev = (double)comb[(curpoint+7)%8]; + double next = (double)comb[(curpoint+1)%8]; + double slope = prev/next + 1; + double distance = (prev / slope) * Math.sqrt(2); + if(comb[curpoint] < distance){return true;} + return false; + } +} +``` From 642d41bed1f07c760e6c33f861424d7f3ac39ccb Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:53:56 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[20250203]=20BOJ=20/=20=EA=B3=A8=EB=93=9C4?= =?UTF-8?q?=20/=20=EB=B0=A9=EC=82=AC=ED=98=95=20=EA=B7=B8=EB=9E=98?= =?UTF-8?q?=ED=94=84=20/=20=EC=9D=B4=EA=B0=95=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3\236\230\355\224\204 \354\235\264\352\260\225\355\230\204.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204" => "lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204.md" (100%) diff --git "a/lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204" "b/lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204.md" similarity index 100% rename from "lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204" rename to "lkhyun/202502/03 BOJ \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204 \354\235\264\352\260\225\355\230\204.md"