Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main () {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- map<long long,bool> m;
- for (long long i = 1; i <= 10000; ++i) {
- long long p = pow(i,3);
- m[p] = true;
- }
- int T;
- cin >> T;
- for (int test_case = 1; test_case <= T; ++test_case) {
- long long n;
- cin >> n;
- bool f = false;
- for (auto p : m) {
- long long x = p.first;
- long long y = n - x;
- if (m.find(y) != m.end()) {
- f = true;
- break;
- }
- }
- if (f) {
- cout << "YES\n";
- } else {
- cout << "NO\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement