From 9b39b3cc28a838a5584839d6d7654a3c75fcf761 Mon Sep 17 00:00:00 2001 From: HeeEul Shin <83682424+ShinHeeEul@users.noreply.github.com> Date: Thu, 6 Mar 2025 23:22:25 +0900 Subject: [PATCH] =?UTF-8?q?[20250306]=20BOJ=20/=20G5=20/=20Contact=20/=20?= =?UTF-8?q?=EC=8B=A0=ED=9D=AC=EC=9D=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShinHeeEul/202503/06 BOJ G5 Contact.md | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ShinHeeEul/202503/06 BOJ G5 Contact.md diff --git a/ShinHeeEul/202503/06 BOJ G5 Contact.md b/ShinHeeEul/202503/06 BOJ G5 Contact.md new file mode 100644 index 00000000..8d0fe133 --- /dev/null +++ b/ShinHeeEul/202503/06 BOJ G5 Contact.md @@ -0,0 +1,39 @@ +```java +import java.io.*; + +public class Main { + + + public static void main(String[] args) throws Exception{ + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + // 1001 1001001 10010010 + + + int N = Integer.parseInt(br.readLine()); + StringBuilder sb = new StringBuilder(); + + for(int i = 0; i < N; i++) { + sb.append(br.readLine().matches("(100+1+|01)+")?"YES":"NO").append("\n"); + } + System.out.println(sb); + } + + + + + private static int read() throws Exception { + int d, o; + d = System.in.read(); + + o = d & 15; + while ((d = System.in.read()) > 32) + o = (o << 3) + (o << 1) + (d & 15); + + return o; + } + +} + + +```