File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments