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