Past
Mier_Samuelle · · 题解
官方题解。
容易发现,当
:::success[实现]{open}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
bool check(ll x){
ll rev = 0, t = x;
while (x){
rev = rev * 10 + x % 10;
x /= 10;
}
return rev == t;
}
void solve(){
cin >> n;
for (int i = 0; ; i++){
if (n - (1ll << i) < 0){
cout << "No" << "\n";
break;
}
if (check(n - (1ll << i))){
cout << "Yes" << "\n";
break;
}
}
return;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--){
solve();
}
return 0;
}
:::