From 321533a92dd56f59cc28bd48fa20d0b5a60a449d Mon Sep 17 00:00:00 2001 From: oncsr Date: Mon, 3 Mar 2025 22:44:29 +0900 Subject: [PATCH] =?UTF-8?q?[20250303]=20BOJ=20/=20G3=20/=20=EC=9A=B8?= =?UTF-8?q?=ED=83=80=EB=A6=AC=20=EC=B9=98=EA=B8=B0=20/=20=EA=B6=8C?= =?UTF-8?q?=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\353\246\254 \354\271\230\352\270\260.md" | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 "khj20006/202503/03 BOJ G3 \354\232\270\355\203\200\353\246\254 \354\271\230\352\270\260.md" diff --git "a/khj20006/202503/03 BOJ G3 \354\232\270\355\203\200\353\246\254 \354\271\230\352\270\260.md" "b/khj20006/202503/03 BOJ G3 \354\232\270\355\203\200\353\246\254 \354\271\230\352\270\260.md" new file mode 100644 index 00000000..c6bd734d --- /dev/null +++ "b/khj20006/202503/03 BOJ G3 \354\232\270\355\203\200\353\246\254 \354\271\230\352\270\260.md" @@ -0,0 +1,50 @@ +```java + +import java.util.*; +import java.io.*; + + +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 long[] D; + static int N; + + public static void main(String[] args) throws Exception { + + ready(); + solve(); + + bwEnd(); + + } + + static void ready() throws Exception{ + + N = Integer.parseInt(br.readLine()); + D = new long[1000001]; + + } + + static void solve() throws Exception{ + + for(int i=1;i<=5;i++) D[i] = i; + D[6] = 7; + for(int i=7;i<=N;i++) D[i] = D[i-6] + i; + bw.write(D[N] + "\n"); + + } + +} + +```