Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- signed main()
- {
- map<int , bool> cube;
- for(int i = 1; i <= 10000; i++){
- cube[i * i * i] = true;
- }
- int t , n;
- cin >> t;
- while(t--){
- cin >> n;
- bool ok = false;
- for(int i = 1; (i * i * i) < n; i++){
- if(cube[n - (i * i * i)]){
- ok = true;
- break;
- }
- }
- cout << (ok ? "yEs" : "nO") << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement