We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c7de6a commit ed80d37Copy full SHA for ed80d37
1 file changed
LiiNi-coder/202510/06 BOJ 종이 접기.md
@@ -0,0 +1,30 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+public class Main{
6
+ static boolean check(String s){
7
+ if(s.length() == 1)
8
+ return true;
9
+ int mid=s.length() / 2;
10
+ for(int i=0; i < mid; i++){
11
+ if(s.charAt(i) == s.charAt(s.length()- 1 - i))
12
+ return false;
13
+ }
14
+ return check(s.substring(0, mid)) && check(s.substring(mid+ 1));
15
16
17
+ public static void main(String[] args)throws IOException{
18
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
19
+ int t = Integer.parseInt(br.readLine());
20
+ StringBuilder sb=new StringBuilder();
21
+ while(t-->0){
22
+ sb.append(check(br.readLine() ) ? "YES\n" : "NO\n");
23
24
25
+ System.out.print(sb.toString());
26
+ br.close();
27
28
+}
29
30
+```
0 commit comments