题解 | 魔法棒
魔法棒
https://www.nowcoder.com/practice/976bd95dda8f4430b512d0c39bd9f106
// 感觉靠大脑去思考,这个题,需要自己靠枚举来发现规律
#include <iostream>
#include <cmath>
#include <unordered_set>
using ll = long long;
using namespace std;
unordered_set<ll>exist;
void solve()
{
ll x;cin>>x;
if (x == 1||x == 4||x == 9||x == 7||x == 13||x == 12||x >=15||x== 10)
{
cout<<"Yes\n";return ;
}
cout<<"No\n";
}
int main() {
ios::sync_with_stdio(false);cin.tie(nullptr);int t;cin>>t;while (t--)solve();return 0;
}
// 64 位输出请用 printf("%lld")
RogeAustine题解系列 文章被收录于专栏
这里是RogeAustine的题解专栏,里面包含的题目都是十分典型的经典题目。
