I solved the question AMR12D. when i submitted the solution
#include <bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define RALL(v) (v).rbegin(),(v).rend()
int main()
{
** ios_base::sync_with_stdio(false);**
** cin.tie(NULL);**
** int t;**
** cin>>t;**
** while(t–)**
** {**
** string orig;**
** cin>>orig;**
** string rev = orig;**
** reverse(rev.begin(),rev.end());**
** if(orig == rev)**
** cout<<“YES”<<endl;**
** else**
** cout<<“NO”<<endl;**
** }**
** return 0;**
}
which was really suprising to me because the logic of the question is pretty simple
now for the same code i commented out
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
it resulted in ac,
could anyone explain whats going here
created
last reply
- 1
reply
- 1.2k
views
- 2
users
- 1
link