Result: Accepted
Time: 3ms
Memory: 17580kB
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<set>
#define ll long long
using namespace std;
const int maxn = 1001000;
const int inf = 0x3f3f3f3f;
#define PI 3.141592653589
#define fr(i,r,l) for(int i=r;i<=l;i++)
ll a[maxn];
ll b[maxn];
int main()
{
int n;
cin >> n;
int s = n;
int s1, s2, s3;
s1 = n % 10;
s2 = n / 10 % 10;
s3 = n / 100;
if (pow(s1, 3) + pow(s2, 3) + pow(s3, 3) == n)
{
printf("YES\n");
}
else printf("NO\n");
}