Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
646 B
2
Indexable
Never
#include<bits/stdc++.h>
using namespace std ;
#define int  long long 

bool palindrome (string s ){
    int n =s.length();
    int i=0;
    while(i<n/2){
        if(s[i]!=s[n-1-i])
        return false ;
    }
    return true ;
}

int32_t main(){
    int n ;
    cin>>n ;
    vector<string>v(n);
    for(int i=0;i<n ;i++){
        string s ;
        cin>>s ;
        v[i]=s;
    }
    for(int i=0;i<n ;i++){
        for(int j=0;j<n ;j++){
            if(i==j)continue;
            string temp= v[i]+v[j];
        
        if(palindrome(temp))cout<<"Yes";
        else cout<<"No";
        }
    }
    return 0;

}