Skip to content

Commit 83549aa

Browse files
authored
[20260317] BOJ / G4 / 잠수함식별 / 이준희
1 parent 57bcc5c commit 83549aa

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
```java
2+
import java.io.*;
3+
import java.util.*;
4+
5+
public class Main {
6+
public static void main(String[] args) throws Exception {
7+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8+
String sound = br.readLine();
9+
10+
String regex = "(100+1+|01)+";
11+
12+
if (sound.matches(regex)) {
13+
System.out.println("SUBMARINE");
14+
} else {
15+
System.out.println("NOISE");
16+
}
17+
}
18+
}
19+
```

0 commit comments

Comments
 (0)