Skip to content

Instantly share code, notes, and snippets.

@hsuan1117
Last active November 6, 2019 05:37
Show Gist options
  • Save hsuan1117/e9d78809dadd2a8c65158a02e3da0cf9 to your computer and use it in GitHub Desktop.
Save hsuan1117/e9d78809dadd2a8c65158a02e3da0cf9 to your computer and use it in GitHub Desktop.
#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