1 solutions

  • 0
    @ 2026-6-6 10:43:51
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long LL; 
    LL check(LL x)
    {
    	LL res=0;
    	LL t=x;
    	while(x)
    	{
    		LL ge=x%10;
    		res=res*10+ge;
    		x/=10;
    	}
    	//cout<<res<<" "<<t<<endl;
    	return res==t;
    }
    int main()
    {
    	LL n;
    	cin>>n;
    	LL ans=1;
    	for(LL i=1;i*i*i<=n;i++) //枚举三次方 
    	{
    		if(check(i*i*i))
    		{
    			ans=i*i*i;
    		//	cout<<ans<<endl;
    		}
    	}
    	cout<<ans;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2437
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    13
    Accepted
    5
    Uploaded By