From c3a3f9f1acc8fcd12b44804458dcf97dee8f21cd Mon Sep 17 00:00:00 2001 From: monsileI Date: Thu, 7 Jul 2022 19:25:51 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=94=ED=85=8C=20=EB=84=88=EB=AC=B4=20?= =?UTF-8?q?=EC=96=B4=EB=A0=A4=EC=9B=8C=20=E3=85=A0=E3=85=A0=20=EC=96=B8?= =?UTF-8?q?=EC=A0=9C=20=EB=8A=98=EC=96=B4..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sw_java_im/no_1244.java | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/Basic_Of_Algorithm/src/sw_java_im/no_1244.java b/Basic_Of_Algorithm/src/sw_java_im/no_1244.java index 4e344d7..8d5fbb4 100644 --- a/Basic_Of_Algorithm/src/sw_java_im/no_1244.java +++ b/Basic_Of_Algorithm/src/sw_java_im/no_1244.java @@ -1,12 +1,88 @@ package sw_java_im; +import java.util.Scanner; + public class no_1244 { public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + int count = sc.nextInt(); + + int [] arr = new int[count+1]; + + arr[0] = 0; + + for(int i=1;i=arr.length) break; + + + } + + + }else { + + if(arr[loc]==0) arr[loc] = 1; + else arr[loc] = 0; + + int left = loc-1; + int right = loc+1; + + while(true) { + + if(left<1 || arr.length