-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKattis_erase.cpp
More file actions
36 lines (29 loc) · 864 Bytes
/
Kattis_erase.cpp
File metadata and controls
36 lines (29 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <bits/stdc++.h> // here we have all the STL we need, including istringstream and ostringstream
#define ALL(x) x.begin(), x.end()
#define FAST std::cin.tie(0); ios::sync_with_stdio(false); std::cout.tie(0);
using namespace std;
#define endl "\n"
// WTF??? why WA?? the idea is 100% valid and I saw the same code in Java it gives AC!!!.
int main() {
FAST
int N;
string s1, s2;
scanf("%d", &N);
getchar(); // Clear the newline character
getline(cin, s1);
getline(cin, s2);
bool suc = true;
if (N % 2 == 0) {
suc = (s1 == s2);
}
else {
for (int i = 0; i < s1.length(); i++) {
if (s1[i] == s2[i]) {
suc = false;
break;
}
}
}
if (suc) cout << "Deletion succeeded" << endl;
else cout << "Deletion failed" << endl;
}