We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5976e34 + 9b39b3c commit e43eeebCopy full SHA for e43eeeb
ShinHeeEul/202503/06 BOJ G5 Contact.md
@@ -0,0 +1,39 @@
1
+```java
2
+import java.io.*;
3
+
4
+public class Main {
5
6
7
+ public static void main(String[] args) throws Exception{
8
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
9
10
+ // 1001 1001001 10010010
11
12
13
+ int N = Integer.parseInt(br.readLine());
14
+ StringBuilder sb = new StringBuilder();
15
16
+ for(int i = 0; i < N; i++) {
17
+ sb.append(br.readLine().matches("(100+1+|01)+")?"YES":"NO").append("\n");
18
+ }
19
+ System.out.println(sb);
20
21
22
23
24
25
+ private static int read() throws Exception {
26
+ int d, o;
27
+ d = System.in.read();
28
29
+ o = d & 15;
30
+ while ((d = System.in.read()) > 32)
31
+ o = (o << 3) + (o << 1) + (d & 15);
32
33
+ return o;
34
35
36
+}
37
38
39
+```
0 commit comments