Skip to content

Commit 6894782

Browse files
committed
atcoder/abc003B
1 parent 9abf4e2 commit 6894782

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

atcoder/abc003/B/main.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = int64_t;
5+
using ff = long double;
6+
7+
int main() {
8+
ios_base::sync_with_stdio(false);
9+
cin.tie(0); cout.tie(0);
10+
11+
string S, T;
12+
cin >> S >> T;
13+
assert(S.size() == T.size());
14+
15+
string wildcards = "atcoder";
16+
bool win = true;
17+
int N = S.size();
18+
for (int i = 0; i < N; ++i) {
19+
if (S[i] == T[i]) continue;
20+
if (S[i] != '@' && T[i] != '@') {
21+
win = false;
22+
break;
23+
}
24+
char c = ' ';
25+
if (S[i] == '@') c = T[i];
26+
if (T[i] == '@') c = S[i];
27+
if (c != '@' && wildcards.find(c) == string::npos) {
28+
win = false;
29+
break;
30+
}
31+
}
32+
if (win) {
33+
cout << "You can win" << endl;
34+
} else {
35+
cout << "You will lose" << endl;
36+
}
37+
38+
return 0;
39+
}

0 commit comments

Comments
 (0)