Last active
November 6, 2019 05:37
-
-
Save hsuan1117/e9d78809dadd2a8c65158a02e3da0cf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
string a , b; | |
int N; | |
cin >> N >> a >> b ; | |
bool will = true; | |
for(int i=0;i<N;i++) { | |
if(a[i]=='0'){ | |
if(i!=0||i!=N-1){ | |
if(b[i]=='1'&&(b[i+1]=='1'||b[i-1]=='1')){ | |
will = false; | |
} | |
}else if(i==0){ | |
if(b[i]=='1'&&(b[i+1]=='1')){ | |
will = false; | |
} | |
}else{ | |
if(b[i]=='1'&&b[i-1]=='1'){ | |
will = false; | |
} | |
} | |
} | |
} | |
if(will){ | |
cout << "FENESTRATION FORTIFICATION FAILURE!\n"; | |
}else{ | |
cout << "FENDED OFF!\n"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment