We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4cd547 commit c39d296Copy full SHA for c39d296
1 file changed
정건우/3주차/260115.java
@@ -0,0 +1,29 @@
1
+//https://www.acmicpc.net/problem/9243
2
+import java.io.BufferedReader;
3
+import java.io.IOException;
4
+import java.io.InputStreamReader;
5
+
6
+public class BOJ_B2_9243_파일완전삭제 {
7
+ public static void main(String[] args) throws IOException {
8
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
9
10
+ int N = Integer.parseInt(br.readLine());
11
+ char [] arr = br.readLine().toCharArray();
12
+ String s2 = br.readLine();
13
14
+ if(N % 2 == 1) {
15
+ for(int i = 0; i < s2.length(); i++) {
16
+ arr[i] = arr[i] == '1' ? '0' : '1';
17
+ }
18
19
20
+ String s1 = String.valueOf(arr);
21
22
+ if(s1.equals(s2)) {
23
+ System.out.println("Deletion succeeded");
24
+ } else {
25
+ System.out.println("Deletion failed");
26
27
28
29
+}
0 commit comments