From c6995001c0e6a276c07c5877e8acba6b06b4b6a1 Mon Sep 17 00:00:00 2001 From: oncsr Date: Mon, 3 Feb 2025 15:32:04 +0900 Subject: [PATCH] =?UTF-8?q?[20250203]=20BOJ=20/=20=EA=B3=A8=EB=93=9C4=20/?= =?UTF-8?q?=20=EB=B0=A9=EC=82=AC=ED=98=95=20=EA=B7=B8=EB=9E=98=ED=94=84=20?= =?UTF-8?q?/=20=EA=B6=8C=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5 \352\267\270\353\236\230\355\224\204.md" | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 "khj20006/202502/03 BOJ G4 \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204.md" diff --git "a/khj20006/202502/03 BOJ G4 \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204.md" "b/khj20006/202502/03 BOJ G4 \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204.md" new file mode 100644 index 00000000..1666090c --- /dev/null +++ "b/khj20006/202502/03 BOJ G4 \353\260\251\354\202\254\355\230\225 \352\267\270\353\236\230\355\224\204.md" @@ -0,0 +1,67 @@ +```java + +import java.util.*; +import java.io.*; + +class Point{ + double x, y; + Point(double x, double y){ + this.x = x; + this.y = y; + } +} + +class Main { + + // IO field + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringTokenizer st; + + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + static long nextLong() {return Long.parseLong(st.nextToken());} + static void bwEnd() throws Exception {bw.flush();bw.close();} + + // Additional field + static double[] A = new double[8]; + static int ans = 0; + + static int ccw(Point a, Point b, Point c) { + double r = (a.x*b.y + b.x*c.y + c.x*a.y) - (b.x*a.y + c.x*b.y + a.x*c.y); + return r > 0 ? 1 : (r < 0 ? -1 : 0); + } + + static void sol(int choose, List arr) { + if(arr.size() == 8) { + for(int i=0;i<8;i++) { + Point a = new Point(0,arr.get(i)); + Point b = new Point(arr.get((i+1)%8) / Math.sqrt(2), arr.get((i+1)%8) / Math.sqrt(2)); + Point c = new Point(arr.get((i+2)%8), 0); + if(ccw(a,b,c) > 0) return; + } + ans++; + return; + } + for(int i=0;i<8;i++) { + if((choose & (1<()); + + bw.write(ans+"\n"); + + bwEnd(); + } + +} + +```