Skip to content

Commit e43eeeb

Browse files
authored
Merge pull request #212 from AlgorithmWithGod/ShinHeeEul
[20250306] BOJ / G5 / Contact / 신희을
2 parents 5976e34 + 9b39b3c commit e43eeeb

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)